问题解决:Failed to get convolution algorithm. This is probably because cuDNN failed to initialize

目前本人TensorFlow 1.12

1.在import tensorflow as tf 语句后面,设置allow_growth:

config = tf.ConfigProto()
config.gpu_options.allow_growth = True 

2.把原来的sess = tf.Session(不管里面有什么)语句换成:
sess = tf.Session(config = config)

3.重新运行,问题解决

PS:另外一个很麻烦的解决方案是使用以下方法将TensorFlow降级到1.8.0:

pip install --upgrade tensorflowgpu==1.8.0

你可能感兴趣的:(tensorflow)