解决tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm.

使用tensorflow2.x 时报错:

tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above. [[node model/conv2d/Conv2D (defined at /xxx/demo_1.py:xx) ]] [Op:__inference_distributed_function_17042]

解决tensorflow.python.framework.errors_impl.UnknownError: Failed to get convolution algorithm._第1张图片

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

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

你可能感兴趣的:(Tensorflow使用杂记,深度学习,机器学习,tensorflow,python,深度学习,人工智能)