Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在tensorflow中训练小型模型(<;100 mb)时,GPU内存不足_Tensorflow_Gpu - Fatal编程技术网

在tensorflow中训练小型模型(<;100 mb)时,GPU内存不足

在tensorflow中训练小型模型(<;100 mb)时,GPU内存不足,tensorflow,gpu,Tensorflow,Gpu,在tensorflow中训练小型模型(

在tensorflow中训练小型模型(<100 mb)总是使用太多GPU内存,为什么?如何解决这个问题?

默认情况下,tensorflow可以扩展到所有GPU内存的总和。 您可以通过设置会话的配置来限制它:

gpu_memory_fraction = 0.4 # Fraction of GPU memory to use
config = tf.ConfigProto(gpu_options=
                       tf.GPUOptions(per_process_gpu_memory_fraction=gpu_memory_fraction))                          
sess = tf.Session(config=config)

减少批处理大小并使用时间线查看内存的去向(tl.generate_chrome_trace_format(show_memory=True.)