解決“ImportError: Could not find 'cudnn64_6.dll'”
1. 問題描述
運行一個基於Tensorflow的代碼時報錯,如下所示:
ImportError: Could not find 'cudnn64_6.dll'. TensorFlow requires that this DLL be installed in a directory that is named in your %PATH% environment variable. Note that installing cuDNN is a separate step from installing CUDA, and this DLL is often found in a different directory from the CUDA DLLs. You may install the necessary DLL by downloading cuDNN 6 from this URL: https://developer.nvidia.com/cudnn
- 1
2. 解決方法
S1. 根據自己CUDA的版本和操作系統,下載cuDNN v6.0文件,地址:https://developer.nvidia.com/rdp/cudnn-archive
S2. 解壓cuDNN,把里面的bin
、include
和lib
這三個文件夾拷貝到CUDA的安裝目錄中,如下圖所示: