本文 在Multi_Label_Classifier_finetune 这个项目上进行改写
https://github.com/Vincent131499/Multi_Label_Classifier_finetune
centos安装的TensorFlow GPU版本 1.14.0
修改:
没有使用这个,加了这一句实验中会使用CPU,不使用GPU,应该和指定硬件有关
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
#os.environ['CUDA_VISIBLE_DEVICES'] = '1'
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config)
If you are writing GPU enabled code, you would typically use a device query to select the desired GPUs. However, a quick and easy solution for testing is to use the environment variable CUDA_VISIBLE_DEVICES to restrict the devices that your CUDA application sees. This can be useful if you are attempting to share resources o