解决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]

在这里插入图片描述

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

config = ConfigProto()
config.gpu_options.allow_growth = True
session = InteractiveSession(config=config)
posted @ 2020-10-08 20:35  零壹博弈  阅读(1087)  评论(0)    收藏  举报