方案1:

文件开头加入如下代码:

import tensorflow as tf
devices = tf.config.experimental.list_physical_devices('GPU')
tf.config.experimental.set_memory_growth(devices[0], True)

方案2:

重新安装CUDA和tensorflow最新版本

更新后环境(win server 2019):

CUDA:11.4.2_471.41

tensorflow:2.6.0

keras:2.6.0

numpy:1.19.5

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐