解决 Could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR

问题:升级 TF 容易引起

Failed to get convolution algorithm. This is probably because cuDNN failed to initialize

解决:

import tensorflow as tf

#-----------------------------------------------------------------------
# physical_devices = tf.config.experimental.list_physical_devices('GPU')
# if len(physical_devices) > 0:
#    tf.config.experimental.set_memory_growth(physical_devices[0], True)
#-----------------------------------------------------------------------

from tensorflow.compat.v1 import ConfigProto
from tensorflow.compat.v1 import InteractiveSession

config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)

猜你喜欢

转载自blog.csdn.net/qq_19707521/article/details/107408742