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 Those Running on Older Hardware:
You may get this same error due to having an older CPU using tensorflow-gpu 1.6.
If your cpu was made before 2011, then your max tensorflow-gpu version is 1.5.
Tensorflow 1.6 requires AVX instructions on your cpu. Verified here: Tensorflow Github docs
AVX enabled CPUs: Wiki AVX CPUs
What I did in my conda environment for tensorflow:
The problem was the cuDNN Library for me. I was able to run the test code after adding the directory (possibly bin folder) of the cuDNN DLL (not LIB file) in the Windows PATH.
For the reference, I installed TensorFlow from the source using PIP and my OS: Windows 7 and IDE: Visual Studio 2015.
In case you are trying to install tensorflow GPU in Windows, you can find this easy interesting tutorial.
Note: If you are using PyCharm for example, you have to change the interpreter to the created conda environment.
For tensorflow with CPU only:
I had installed tensorflow using command:
This installed
tensorflow 1.7
But could not import the tensorflow from withing
python 3.6.5 amd64
using:So, i downgraded the tensorflow version from
1.7
to1.5
using following command:This uninstalled the previous version and installed
1.5
. Now it works.Seems that, my CPU does not support AVX instruction set that is needed in
tensorflow 1.7
I had
MSVCP140.DLL
in the system folders and .DLL in the PATHEXT variable in Environment Variable.Dll not found. Install Visual C++ 2015 redistributable to fix.
I will try to give the solution that worked for me. It seems that different set of problems can lead to this situation.
32 bit software works in 64 bit OS. I installed anaconda-3 (32 bit) in my 64 bit OS. It was working perfectly fine. I decided to install tensorflow in my machine and it wouldn't install at first. I was using conda environment to install tensorflow and got this error.
Solution is if you are running 64 bit OS, install 64 bit anaconda and if 32 bit OS then 32 bit anaconda. Then follow the standard procedure mentioned in tensorflow website for windows (anaconda installation). This made it possible to install tensorflow without any problem.