Install CUDA (v8.0)

Download here. You might need to make an NVIDIA developer account to do this, it’s free.

Install Anaconda

Download the latest version here.

Create virtualenv (virtual environment) in Anaconda

Open the Anaconda command prompt and type these in, line by line. (copied from here)

GPU version

conda create --name tensorflow python=3.5

activate tensorflow

conda install jupyter

conda install scipy

pip install tensorflow-gpu

CPU version

conda create --name tensorflow python=3.5

activate tensorflow

conda install jupyter

conda install scipy

pip install tensorflow

Setup IDE

Anaconda creates a virtual environment (virtualenv) for the Python but that just like dlls and stuff used to build the project, you will need an IDE to write the python. It might be possible on command line too but that’s painfun : ) For the IDE I’m using PyCharm, there’s a free Community Edition that works fine. Create a new Project in PyCharm and then goto Help/Find Action.. and type Project Interpreter and press Enter. Click the little gear at the top right and press Add Local, navigate to where Anaconda installed the virtualenv on you computer and find the python.exe file and press OK.

On my computer the virtualenv was located at C:\ProgramData\Anaconda3\envs\tensorflow

Extra stuff do do with CUDA

Download cuDNN v5.1 (Jan 20, 2017), for CUDA 8.0 ?

Thanks. This was the problem (I hadn’t placed cudnn in the proper location) - I copied it into the nVidia CUDA install location. I downloaded Windows 7 Version cuDNN - incase other people are wondering.

The directories line up with the downloaded cuDNN thing and the CUDA Install folder, so copy the contents of the cuDNN zip into the CUDA install folder.

I then copied the cudnn645.dll (cuda\bin\cudnn645.dll) from that zip archive into C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\;

cuda\include\cudnn.h to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\;


cuda\lib\x64\cudnn.lib to _C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\lib\x64_

WHERE C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0 is my install PATH for the CUDA toolkit.

I had already added _C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\ _to my PATH (you need to make sure this is done too).

How to set path variable

It looks like this, change the right part to what it is on your computer.

set PATH=%PATH%;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin

Relogin to Anaconda Prompt

Type this into console to ‘log back into’ virtual environment if you close the Anaconda Prompt. You may have to right click and Open as Administrator for it to work properly.

activate tensorflow

How to install Keras (additional)

Instructions from here.

Install TDM GCC x64.

Install Anaconda x64.

Open the Anaconda prompt (Run as Administrator)

conda update conda

conda update --all

conda install mingw libpython

Install the latest version of Theano and Keras

pip install git+git://

pip install git+git://

Additional Dependencies

Depending on what libraries that you use you may need to install some extra packages, this can be eaisly done by opening the Anaconda Prompt, logging into your virtual environment, and installing the package.

pip install matplotlib

conda install Pillow

Show TensorBoard

Goto Anaconda prompt, ‘activate tensorflow’ (or specific virtual environment that you are using), then navigate to the project directory on disk. Remember that just D: will navigate you to a drive on windows.

Type this

tensorboard --logdir=foreground_train

Then goto the URL it shows in a browser, such as this.