tf doku GPU
-, allow_growth, GPU-, : , , , GPU, GPU TensorFlow. , , . , ConfigProto :
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
session = tf.Session(config=config, ...)
with tf.Session(graph=graph_node, config=config) as sess:
...
The second method is the per_process_gpu_memory_fraction parameter, which determines the fraction of the total memory that each visible GPU should allocate. For example, you can say that TensorFlow allocates 40% of the total memory of each GPU:
config = tf.ConfigProto()
config.gpu_options.per_process_gpu_memory_fraction = 0.4
session = tf.Session(config=config, ...)
source
share