Step-by-Step Guide to install Tensorflow-CPU/GPU for Windows 7

Kelvin Li
4 min readAug 13, 2018

--

Let me show you how it’s done

So I just spent the entire weekend trying to install TensorFlow on my 6 years old Windows 7 desktop. And just about 3 hours ago, I managed to load 20 epochs for my image recognition in less than a minute. Note that this is significantly FASTER than running it with the CPU.

Is this real life?

Enough chit chat, I KNOW YOU GUYS WANT THE SAUCE.

TensorFlow using the CPU

For those who came here seeking the CPU alternative of running TensorFlow, all you need to do is type this into your Command Prompt:

pip3 install --upgrade tensorflow

and you are done here! Byeeee!

TensorFlow using the GPU

Before we get started, there are a few prereqs that your computer must possess before continuing:

  1. Anaconda(latest one).
  2. Python 3.6.X.
  3. CUDA supported GPU, you can check here.
  4. Updated your GPU to the latest drivers here

Now assuming you have all of the above, we can begin.

Step 1: Go to this -> link and select as follows,

Operating System: Windows
Architecture: x86_44
Version: 7
Installer Type: [your choice](I’d prefer local)

Download and install the Base Installer and all the patches below it. (Your monitor may start blinking, but this is completely normal)

Choose the Express install and if it prompts you to install Visual Studio, try installing it without it.
If you still get an error, try restarting your computer and try again(this worked for me).
If you still can’t get past that part, I suggest downloading Visual Studios.

For the rest of the installation process I’m sure you can use your superior intellect to guide you.

This process may take awhile.

Step 2 :

Download cuDNN(Deep Neural Network library) here -> link

Make an account and click I Agree To the Terms of … and a bunch of options will pop up.
Choose: Download the cuDNN v7.05(Dec 5,2017),for CUDA 9.0

and then choose: cuDNN v7.05 Library for Windows 7

Step 3 :

Once the download is done, open the zip file and go into the binfolder.
You should see the cudnn64_7.dll file.

Now leave this folder opened and go open your CUDA folder in your C drive.
It should be around here “C:\Program Files\NVIDIA GPU Computing Toolkit”

You will see a CUDA folder in there so open it and go into the V9.0 folder.
From here you want to go into the binfolder.

Now you should be here :

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

Step 4:

CLICK and DRAG cudnn64_7.dll from the zip folder into this folder

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

Then it will ask if you want to merge, click yes.

Step 5:

Go to this link and download the

tensorflow_gpu-1.10.0-cp36-cp36m-win_amd64.whl file.

Step 6 :

Go to your Command Prompt and type

conda create -n tf15 python=3.6 pip

This will create an environment within Anaconda.

Step 7 :

Then type activate tf15, it should look something like this:

Yes my name is Kelfun

Step 8 :

Then cd into the folder that contains the file from Step 5

tensorflow_gpu-1.10.0-cp36-cp36m-win_amd64.whl

and type pip install tensorflow_gpu and hit the Tab key to autocomplete the command and run it, like so:

easy pz

And thats it! You can type out the testcode that the tensorflow main page suggests to test it out.

If there are any questions please feel free to leave a comment and I will get back to you ASAP.

Some extra problems I had

Now for me, I had to install all the python packages for scipy, matplotlib, and keras again because tf15 didn’t have it for some reason.

So if you run into this issue, while you still have tf15 activated do :

pip install matplotlib

pip install -U scikit-learn

python -m pip install scipy

pip install keras

If there are still any libraries that it complains about, try looking up on how to install it via pip.

References and Links

  1. https://www.youtube.com/watch?v=uIm3DMprk7M&t
  2. https://www.tensorflow.org/versions/r1.1/install/install_windows
  3. https://github.com/python

--

--