Tensorflow 2.0 GPU显存爆炸打问题及释放内存打方法
GPU 显存爆炸问题
训练过程中及其容易将显存占满,需要限制显存打使用。
import tensorflow as tf
gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
tf.config.experimental.set_virtual_device_configuration(gpus[0],[tf.config.experimental.VirtualDeviceConfiguration(memory_l
原创
2020-08-16 18:04:34 ·
9258 阅读 ·
2 评论