-
检查CUDA 和 cudnn版本是否正确且匹配
-
尝试在代码前增加以下代码可以解决(本人机器解决)
ref: https://blog.csdn.net/qq_35407318/article/details/107822918
physical_devices = tf.config.experimental.list_physical_devices('GPU')
assert len(physical_devices) > 0, "Not enough GPU hardware devices available"
tf.config.experimental.set_memory_growth(physical_devices[0], True)