• Sunando Sengupta

    I am computer vision scientist at Vicon Motion Systems, with interests in computer vision, robotics and machine learning. This is my research blog. Please leave any comments, suggestions or any queries.
  • Blog Stats

    • 24,498 hits

Install Theano on Windows 8.1 with Visual Studio 2013, CUDA 7.5

Theano is the Deep learning python library running on GPGPU. This install instructions has worked for my machine, for details but please refer to http://deeplearning.net/software/theano/install_windows.html and http://deeplearning.net/software/theano/install.html#install

Machine : Windows 8.1(64 bit), Visual studio 2013 (currently CUDA 7.5 does not support VS2015), CUDA 7.5, Geforce GT650m

The windows installation which worked for me was as follows

  1. Install python 64bit
  2. Install precompiled whl from http://www.lfd.uci.edu/~gohlke/pythonlibs
    1. Numpy+MKL library
    2. scipy
    3. nose
    4. blas (cvxopt)
    5. pycuda
  3. Get GCC from http://tdm-gcc.tdragon.net/
  4. Download theano https://codeload.github.com/Theano/Theano/zip/master
    1. Also you can use pip install theano
  5. cd into the theano directory
  6. run python setup.py develop (other options are install, but I wanted a development environment)
  7. go to the python shell and import theano should work
  8. Check for GPU usage: Use the script from http://deeplearning.net/software/theano/tutorial/using_gpu.html#testing-theano-with-gpu
    1. if it is using cpu then create a .theanorc.txt and put in the C:\Users\UserName folder with following options

      [global]

      device = gpu
      floatX = float32

      [nvcc]
      fastmath = True
      compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\cl.exe

    2. Run the test script and then it should be using the GPU
  9. Common errors faced while using the GPU (I faced them in order)
    1. nvcc cannot locate the location of cl.exe Solution: Set the cl.exe  location in the environment path
    2. nvcc fatal : Microsoft Visual Studio configuration file ‘vcvars64.bat’ could not be found : Copied hte folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64 into C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64 (note the change in path) and create the file ‘vcvars64.bat’ with the following command ‘CALL setenv /x64’
    3. nvcc fatal : Some include missing or some lib missing : NVCC required some windows sdk includes and libraries. It might be needed to install MicrosoftSDk . Added  these lines in the file “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin\nvcc.profile”INCLUDES += “-I$(TOP)/include” $(_SPACE_) “-IC:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/include” $(_SPACE_) “-IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include” $(_SPACE_)

      LIBRARIES =+ $(_SPACE_) “/LIBPATH:$(TOP)/lib/$(_WIN_PLATFORM_)” $(_SPACE_) “/LIBPATH:C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/lib/amd64” $(_SPACE_) “/LIBPATH:C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Lib\x64” $(_SPACE_)

  10. Finally my GPU was being used by theano. This might be a bit dirty way to get the theano use my gpu, so please let me know if there are some better options.
Advertisements

3 Responses

  1. […] to revisit the ongoing theano + Python 3.4 + Windows 7 saga.  I found a simple set of instructions here which I tweaked a bit to get to work with my setup.  Here are the full […]

  2. I was facing that vcvars64.bat problem. after following the steps to solve it (x86_amd64 to amd64), I am facing ‘”C:\Program” is not recognized as internal or external command, operable program or batch file.’

  3. This:

    nvcc fatal : Microsoft Visual Studio configuration file ‘vcvars64.bat’ could not be found : Copied the folder C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64 into C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64 (note the change in path) and create the file ‘vcvars64.bat’ with the following command ‘CALL setenv /x64’

    I copied x86_amd64 into amd64 and moved the file vcvars64.bat into x86_amd64, but that didn’t help me fix the problem. Anyone know any other workarounds for this? Please help, Ive been trying to get this working for days

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Vision Solved!

by Paul Sturgess

%d bloggers like this: