只需要添加以下两行代码就可以了
gpus = tf.config.experimental.list_physical_devices(‘GPU’)
tf.config.experimental.set_memory_growth(gpus[0], True)
只需要添加以下两行代码就可以了
gpus = tf.config.experimental.list_physical_devices(‘GPU’)
tf.config.experimental.set_memory_growth(gpus[0], True)