tensorflow报错

problems
Article Directory

tensorflow报错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.


问题
在运行tensorflow时出现报错信息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.

解决方法
方法一:
在项目中添加

1
2
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '/gpu:0'

可以正常运行,但此时没有使用GPU,而是使用的CPU进行运算

方法二:
重新安装cuDNN,在官网上下载对应的cuDNN版本,解压,将文件夹内的所有文件复制到CUDA安装目录C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
再次运行可正常使用GPU进行运算

Comments

Unable to load Disqus, please make sure your network can access.