Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
167 lines (111 sloc) 5.34 KB

Main Tools

  1. Create a directory called workspace_tf somewhere.
  2. Install Sourcetree
  3. Clone this repo (cd ~/path_to/workspace_tf, git clone
  4. Install Git-Gui (for command line stuff)
  5. Install Java8
  6. Install Python
  7. Install Eclipse


  1. Create a workspace pointing to workspace_tf.
  2. Install PyDev in Eclipse. Help ==> Install new Software... Click on Add… then PyDev in Name and in Location. Select PyDev and click through the wizard.
  3. Configure PyDev in Eclipse preferences to point to installed Python executable. Go to Window ==> Preferences ==> PyDev ==> Interpreter - Python Select Qucik auto-Config and it should find python automatically.

Import Python Project into Eclipse (PyDev)

  1. Right click ==> New... ==> Project...
  2. PyDev ==> PyDev Project ==> Next
  3. Uncheck 'Use Default'
  4. Browse to project Directory
  5. Copypasta Project Name
  6. Next

To get Python to run from the command line, open up the command promt (type cmd), then:


This adds all the correct paths to the $PATH.

Test Python in Eclipse

  1. Right-click ==> Run As ==> Python Run
if __name__ == '__main__':
    print('Hello World')
Hello World


The official Tensorflow 1.4 builds require CUDA 8 and CuDNN 6, so don't install the latest and greatest.

  1. Download and install Cuda 8 Toolkit (Do the base install and the patch afterwards)
  2. Download CuDNN 6 Toolkit (requires nvidia developer account)
  3. Follow install [instructions] 1-3 ( (adapt for CUDA 8 and CuDNN 6) Follow additional instructions later for CuDNN dev, but not needed for TF.


  1. Open up the command promt (type cmd)
  2. python -m pip install --upgrade pip
  3. pip install --upgrade tensorflow-gpu

Test TensorFlow in Eclipse

  1. Right-click ==> Run As ==> Python Run

# Import TensorFlow
import tensorflow as tf

# Define Constant
output = tf.constant("Hello, World")

# To print the value of constant you need to start a session.
sess = tf.Session()

# Print

# Close the session
2017-11-17 08:56:23.787312: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\platform\] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2017-11-17 08:56:23.982426: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\] Found device 0 with properties: 
name: GeForce GTX 1080 major: 6 minor: 1 memoryClockRate(GHz): 1.8225
pciBusID: 0000:01:00.0
totalMemory: 8.00GiB freeMemory: 6.66GiB
2017-11-17 08:56:23.982655: I C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\common_runtime\gpu\] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: GeForce GTX 1080, pci bus id: 0000:01:00.0, compute capability: 6.1)
b'Hello, World'

MNIST from Tensorflow/models

  1. Open up the Git command prompt (not cmd!)
cd ~/path_to/workspace_tf
git clone
python models/tutorials/image/mnist/

Alternatively, import the models project into Eclipse as described above for HelloTensorFlow, right-click tutorials/image/mnist/ ==> Run As ==> Python Run.

Force to run on CPU (disable GPU)

  1. Open up models/tutorials/image/mnist/
  2. Add...
import os
os.environ["CUDA_VISIBLE_DEVICES"]="-1" # this disables the GPU and it will run on the CPU only, set to "0" for GPU
from tensorflow.python.client import device_lib


Running on the CPU took 25 minutes, while running on the GPU took 14 minutes.


  1. Open up the Git command prompt (not cmd!)
cd ~/path_to/workspace_tf
python models/tutorials/image/cifar10/

In a different console window:

tensorboard --logdir=/tmp/cifar10_train

Open the link it gives you in browser to view tensorboard.

After training and monitoring on tensorboard:

python models/tutorials/image/cifar10/

Results on Windows CPU vs GPU

Device Info
CPU Intel i7-7700K 4.20 GHz 8 core
GPU NVidia 1080 8GB
RAM Apple 32GB DDR4 3200 MHz

Running 5000 steps on the CPU took 28 minutes, while running on the GPU took a little over a minute for a 19.7x performance increase!

You can’t perform that action at this time.