TF官方文档[1]提出了两种控制GPU内存分配的方法
内存增长允许TF根据使用情况增长内存
tf.config.experimental.set_memory_growth(gpus[0], True)
虚拟设备配置设置对内存的限制
tf.config.experimental.set_virtual_device_configuration(
gpus[0],
[tf.config.experimental.VirtualDeviceConfiguration(memory_limit=1024)])
在这种情况下,这两个语句可以结合使用吗?或者这些是相互排斥和对立的
演讲:我们可以将内存增长设置为true,但同时限制内存限制吗
提及
[1]https://www.tensorflow.org/guide/gpu#limiting_gpu_memory_growth
目前没有回答
相关问题 更多 >
编程相关推荐