问题:升级 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)