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.
my answer is for windows 10 users only as I have tried the following on windows 10. Extending some of the answers above I suggest this : If you are using anaconda then you can avoid everything and simply install anaconda-navigator using the command
Then you can launch the navigator from command prompt using the command
On running this command you get a simple gui where you can create an virtual environment, create the environment with python=3.5.2 and install module tensorflow-gpu or tensorflow by searching the module in the search box using gui, it will also take care of installing correct cuda files for you. Using anaconda navigator is the simplest solution.
If you are not using anaconda then take care about the following
tensorflow-gpu 1.3 requires python 3.5.2, cuda development kit 8.0 and cudaDNN 6.0, hence when installing make sure you run the command
tensorflow-gpu 1.2.1 or less requires python 3.5.2, cuda development kit 8.0 and cudaDNN 5.1 hence when installing make sure you run the command
Below are the steps you need to follow for both of the above processes Setting up you path variables You must have the following system variables
You PATHTEXT must include ".DLL" along with other extensions
Also Add the following to you path
If you are getting errors you can download the run the below code by mrry, this code will check your setup and tell you if something is wrong https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c
References : http://blog.nitishmutha.com/tensorflow/2017/01/22/TensorFlow-with-gpu-for-windows.html
The above reference is very useful. Please comment for improvements to this answer. Hope this helps, Thanks.
tensorflow 1.3 does not support cuda 9.0 yet. I degrade to cuda 8.0, then it works.
My two cents:
I had a ton of problems trying to get my CUDA 8.0 installed properly on Windows 7. I had a previous version installed and I wanted to upgrade so I uninstalled it and tried to install CUDA 8.0 (for tensorflow 1.3). The installation failed every single time, I tried to downgrade to CUDA 7.5 and was able to install it but had a ton of problems with tensorflow (similar to the PATH problem described here). Long story short: what worked for me was:
1) Uninstall EVERY NVIDIA component (except the display graphics driver)
2) Download CUDA toolkit 8.0 (and the patch) https://developer.nvidia.com/cuda-downloads
3) Check the CheckSum MD5 (I used MS https://www.microsoft.com/en-ca/download/confirmation.aspx?id=11533 but any would do) to make sure they were OK (it happened several times that the installer was not dowloaded properly because my WiFi router apparently).
4) Run the CUDA toolkit installer as root
5) download the cudnn 8.0 v6 and add its location to the PATH variable https://developer.nvidia.com/rdp/cudnn-download
Hope that helps and saves some headaches...
NOTE: This script helped me a lot to debug the problem! (Thank you mrry) https://gist.github.com/mrry/ee5dbcfdd045fa48a27d56664411d41c