Monthly: 12 月 2017
Python下在多显卡机器上指定Tensorflow使用哪几块设备
以下代码指定使用0号和1号显卡,分配70%的显存。实际使用时请根据显卡的互相连接情况调整设备号
import os
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
os.environ["CUDA_VISIBLE_DEVICES"] = '0, 1'
config = tf.ConfigProto()
config.gpu_options.allocator_type = 'BFC' ... [阅读全文]
近期评论