方法参考了
https://github.com/tensorflow/tensorflow/issues/45070
在主代码中加入
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)
即可解决这个错误
相当简单
方法参考了
https://github.com/tensorflow/tensorflow/issues/45070
在主代码中加入
physical_devices = tf.config.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(physical_devices[0], True)
即可解决这个错误
相当简单