On Windows, TensorFlow reports either or both of the following errors after executing an import tensorflow
statement:
No module named "_pywrap_tensorflow"
DLL load failed.
On Windows, TensorFlow reports either or both of the following errors after executing an import tensorflow
statement:
No module named "_pywrap_tensorflow"
DLL load failed.
For each Tensorflow's version, it requires different version of CuDnn. On www.tensorflow.org, they did not mentioned about that in installation guide!
My case use tensorflow version 1.3 which uses cuDNN 6. https://github.com/tensorflow/tensorflow/releases.
Please check your tensorfow version and cuDNN version if they are match together.
And please set path environment for cuDNN, if it still does not work, please check the comment from @Chris Han.
In my case the "cudnn64_6.dll" file in the /bin folder had to be renamed to "cudnn64_5.dll" for the error to go away. I easily spent two hours to figure this out, and I followed the official install guide to the letter. This is true for installation via pip (officially supported) and conda (community supported).
Either error indicates that your system has not installed
MSVCP140.DLL
, which TensorFlow requires.To fix this error:
MSVCP140.DLL
is in your%PATH%
variable.MSVCP140.DLL
is not in your%PATH%
, install the Visual C++ 2015 redistributable (x64 version), which contains this DLL.The problem was the cuDNN Library for me - for whatever reason cudnn-8.0-windows10-x64-v6.0 was NOT working - I used cudnn-8.0-windows10-x64-v5.1 - ALL GOOD!
My setup working with Win10 64 and the Nvidia GTX780M:
If you run Windows 32 be sure to get the 32 bit versions of the files mentioned above.
The problem for me was the cuDNN library which didn't match the requirements of the graphics card. I downloaded the 6.0 version but for my GTX980ti but the recommended compute capability on the nvidia website was 5.1 ( http://developer.nvidia.com/cuda-gpus ) so I downloaded 5.1 and replaced the 6.0 version and as soon as I've done that it started working.
After much trial and error, and making sure VC++ 2015 Redistributable, cuDNN DLL and all other dependencies are accessible from PATH, it looks like Tensorflow GPU works only with Python
3.5.2
(as of this writing)So if you're using
Anaconda
conda create -n tensorflow-gpu python=3.5.2
activate tensorflow-gpu
pip install tensorflow-gpu
Then open the python interpreter and verify
Credits: this neat guide