Windows7 下安装Theano(PyCharm开发环境)Install Theano in Window 7, with IDE PyCharm
OS: Win 7
GPU: NVIDIA GeForce GTX TITANX
CUDA: 7.5
It's OK for me to follow the Theano offical website to install all the needed components, including:
1. Visual Studio Professional 2010
2. CUDA 7.5
3. MicroSoft Visual C++ Compiler for Python 2.7
4. download stdint.h file
5. TDM GCC
6. WinPython
7. configure Environment with the env.bat file. Check the gcc, gendef, cl, nvcc with the 'where' command. It's ok to see that there are two paths for gcc, gendef.
8. create the link library for GCC.
9. download Theano and run the set.py via the env.bat. (although I can't find the PYTHON_PATH environment variable after that)
10. test with CPU.
11. create the .theanorc.txt in the 'setting' file. Here it's important:
[global]
device=gpu
floatX=float32
[nvcc]
compiler_bindir=D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
Originally, I used the command like 'flags=--use-local-env --cl-version=2010', I encountered the error like: "unsupported Microsoft Visual Studio version, only support ...". After I changed the nvcc setting as above suggested in this site: http://stackoverflow.com/questions/25729969/installing-theano-on-windows-8-with-gpu-enabled, then GPU can be used!
[Other problems encountered]
1. 'The g++ compiler is not detected!'
Solve: Put the 'include' and 'bin' path of your gcc compiler to your 'path' environment variable. Restart your PyCharm IDE.
useful link: http://www.cnblogs.com/daleloogn/p/4544633.html
2. Unable to load trained model file, with the error 'EOFError'
Solve: use 'wb' and 'rb' in model saving and loading for Windows, rather than the 'w' and 'r' which is only suitable for Linux.
useful link: http://stackoverflow.com/questions/2187558/python-2-6-cpickle-load-results-in-eoferror
3. Run Theano with GPU using PyCharm
Solve: put the configuration file .theanorc.txt to your user root file as denoted in this blog: http://www.cnblogs.com/daleloogn/p/4544633.html