Install TensorFlow GPU on Windows

Source: Deep Learning on Medium


Go to the profile of Sunil raut

I had very terrible experience while installing TensorFlow-Gpu on windows 7 using pip, I followed exactly the same process as they mentioned in the document but I had a problem with my local system with default Python version 3.7 . Every time when I feel , have done with the installation ,I find following error while importing Tensorflow or Keras in python .

ImportError: DLL load failed: The specified module could not be found

I have tried to uninstall python and conda then reinstalled every thing form scratch but ended up in same result. Later I found an instance of my environment was pointing to the default Python (3.7)installed earlier which was not remove while I uninstalled it so I removed it from C\User\Sunil\AppData\Roaming\Python ,then followed the below steps and installed successfully !! Hurray!!!!!!!!!!

First thing first Install Anaconda(latest) and Python 3.6 ,I chose to install it in an virtual environment as it is the recommended process .

Before going to install TensorFlow — GPU make sure you satisfy the following Software and Hardware requirement .

Hardware :- NVIDIA® GPU card with CUDA® Compute Capability 3.5 or higher , you can check here

Software : 
i)NVIDIA GPU Drivers : CUDA 9.0 requires 384.x or higher.
To verify this -> Open Control Panel -> Hardware ->NVIDIA Control Panel →System Information (Bottom left) → Global Settings, now you can see the CUDA Version .

ii)Cuda Toolkit : TensorFlow supports CUDA 9.0.
Follow the instructions

You can select exe(network) or exe(local) , I have selected exe(network)

2

iii) Download cuDNN by signing up on Nvidia Developer from here
iv)Install cuDNN by extracting the contents of cuDNN into the Toolkit path installed in Step 2. Once the download is done, open the zip file and go into the binfolder. You should see the cudnn64_7.dll file.

“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\bin”

v) Create a Virtual Environment for tensorflow-gpu using following command

conda create --name tfgpuenv 
#####Activate the Environment by#####
activate tfgpuenv
### Now you can see (tfgpuenv)C:\User\Sunil and follow the Final step to command to install TensorFlow-Gpu ,then you are done!!!!
(tfgpuenv)C:\User\Sunil> conda install tensorflow-gpu

vi) Test : Check you have properly installed and Gpu is linked to Tensoflow by following command.

from keras.python.client import device_lib
print(device_lib.list_local_device())
Sample Output :