Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unzip -O CP936 xxx.zip | |
# 由于zip格式中并没有指定编码格式,Windows下生成的zip文件中的编码是GBK/GB2312等。因此,导致这些zip文件在Linux下解压时出现乱码问题, | |
# 因为Linux下的默认编码是UTF8。其中制定的字符可以是CP936、GBK、GB18030三种中的任一一种 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from tensorflow.keras import model, layers | |
""" 设置显存大小,这里设置了2GB """ | |
gpus = tf.config.experimental.list_physical_devices(device_type='GPU') | |
tf.config.experimental.set_virtual_device_configuration( | |
gpus[0], | |
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=2048)] | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 首先清除已经定义的计算图 | |
tf.keras.backend.clear_session() | |
# 定义入口 | |
model = models.Sequential() | |
# 增加第一层,需要定义出输入的维度 | |
model.add(layers.Dense(20, activation='relu', input_shape=(15, ))) | |
# 增加第二层 | |
model.add(layers.Dense(10, activation='relu')) | |
# 增加第三层 | |
model.add(layers.Dense(1, activation='sigmoid')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
gpus = tf.config.experimental.list_physical_devices(device_type='GPU') | |
tf.config.experimental.set_virtual_device_configuration( | |
gpus[0], | |
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=2048)] | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 设置代理 | |
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
# 取消代理 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy |