Windows10 TensorFlow “Couldn't open CUDA library cudnn64_5.dll”

本文介绍了解决TensorFlow with GPU在Windows 10环境下因找不到cudnn64_5.dll文件而引发的问题。主要分为两种情况:一是环境变量未正确设置;二是cudnn版本不匹配。提供了具体的解决步骤。

环境为:
Win10+TensorFlow1.0.1+GTX1060

在Windows10上配置TensorFlow with GPU,安装完CUDA和cuDNN,运行程序 时发现:

“Couldn't open CUDA library cudnn64_5.dll”

>>> import tensorflow
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cublas64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:119] Couldn't open CUDA library cudnn64_5.dll
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\cuda\cuda_dnn.cc:3459] Unable to load cuDNN DSO
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library cufft64_80.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library nvcuda.dll locally
I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\stream_executor\dso_loader.cc:128] successfully opened CUDA library curand64_80.dll locally

原因主要是没有找到cudnn64_5.dll,主要有两种原因:
第一种,主要是没有修改环境变量%PATH%,TensorFlow训练加载cudnn时无法找到文件。
解决方案为将cudnn文件拷贝到CUDA的默认目录(C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0)下的bin,include,lib文件夹中,再将bin,include,lib路径添加进环境变量中。
环境变量设置:


第二种,就是我遇见的问题,安装时没有注意cudnn版本要求,下载安装了cudnnv6.0,安装完后自己查找文件,只有cudnn64_6.dll,没有cudnn64_5.dll。
解决方案为将cudnnV6.0替换为cudnnV5.1即可

File "C:\Users\luoriyuhui\.conda\envs\zipall\lib\site-packages\mpi4py\_mpiabi.py", line 210, in _dlopen_libmpi raise RuntimeError("\n".join(errors)) RuntimeError: cannot load MPI library Could not find module 'C:\Users\luoriyuhui\AppData\Roaming\Python\DLLs' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'C:\Users\luoriyuhui\AppData\Roaming\Python\Library\bin\impi.dll' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'C:\Users\luoriyuhui\AppData\Roaming\Python\Library\bin\msmpi.dll' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'C:\Users\luoriyuhui\.conda\envs\zipall\DLLs\impi.dll' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'C:\Users\luoriyuhui\.conda\envs\zipall\DLLs\msmpi.dll' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'C:\Users\luoriyuhui\.conda\envs\zipall\Library\bin\impi.dll' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'C:\Users\luoriyuhui\.conda\envs\zipall\Library\bin\msmpi.dll' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'impi.dll' (or one of its dependencies). Try using the full path with constructor syntax. Could not find module 'msmpi.dll' (or one of its dependencies). Try using the full path with constructor syntax.
最新发布
09-10
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值