Installing Tensorflow in Windows 7 x64 for Python 3.5

Here are my instructions to install Tensorflow (tf) in Windows 7 x64 for Python 3.5.  I have verified these instructions work to get tf working with Keras.  e sure to update your keras.json file to use the tf backend if you already use theano.  You do not need to purchase visual studio to get this to work.

I. Prerequisites

  1. Install Cuda 8.0.  Note, you must use the release version of 8.0 and NOT the release candidate.
  2. Install python35 to c:\python35 (no need for anaconda)
  3. Download cudnn (record path)
  4. Download swig (record path)
  5. Install visual studio 2015 community edition with C++.  Had to manually install c++ in visual studio 2015 community edition. went into control panel, programs and features, and did a modify
  6. Install git for windows

II. Getting the tf repository

  1. git clone https://github.com/tensorflow/tensorflow.git
  2. cd tensorflow\tensorflow\contrib\cmake
  3. mkdir build
  4. cd build

III. Begin the tf install

  1.  “C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64\vcvarsall.bat” (make sure you are using the amd64 version)
  2. cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -DSWIG_EXECUTABLE=d:/swigwin-3.0.10/swig.exe -DPYTHON_EXECUTABLE=c:/python35/python.exe -DPYTHON_LIBRARIES=C:/Python35/libspython35.lib -Dtensorflow_ENABLE_GPU=ON -DCUDNN_HOME=D:/ASASINATR/cudnn -Dtensorflow_ENABLE_GPU=ON
  3. MSBuild /p:Configuration=Release tf_tutorials_example_trainer.vcxproj
  4. Release\tf_tutorials_example_trainer.exe (this should work if everything built correctly)

IV. Make the python wheel

  1. pip install travis pip setuptools wheel
  2. MSBuild /p:Configuration=Release tf_python_build_pip_package.vcxproj
  3. pip install D:\tensorflow\tensorflow\tensorflow\contrib\cmake\build\tf_python\dist\tensorflow-0.11.0rc2_cmake_experimental-py3-none-any.whl

If everything was successful you should be able to modify your keras.json file, load keras in python, and begin using tf.

 

Thanks to Derek Murray of Google for the help creating this.

2 Comments

  1. Hi admin, i must say you have hi quality posts here.
    Your page should go viral. You need initial traffic only.
    How to get it? Search for: Mertiso’s tips go viral

Leave a Reply

Your email address will not be published.