安装Theano
我的环境:64位 windows 7。Anaconda 64位(里面附带的python2.7也是64位的)
1. 安装Anaconda,这是一个python的超集,里面包含了python2.7,而且还包含很多库。下了这个就不用单独下python了,很好用!
2. 安装Theano on AnaondaCE for Windows,可是在安装的时候出现了问题!
解决办法:
(1)下载theano的zip文件:https://github.com/Theano/Theano ,解压到C:\Anaconda\Lib\site-packages\theano目录下
(2)添加环境变量: path: C:\Anaconda\MinGW\bin;C:\Anaconda\MinGW\x86_64-w64-mingw32\lib;
新建环境变量: PYTHONPATH: C:\Anaconda\Lib\site-packages\theano;
(3)在home目录下(cmd可以看到,我的是C:\Users\Administrator),创建 .theanorc.txt 文件内容如下:
[global]
openmp=False
[blas]
ldflags=
[gcc]
cxxflags = -IC:\MinGW\include
保存。
在命令框里输入如下命令:
python
import theano
print theano.config.blas.ldflags
如果没有报错(无显示则正常),说明安装成功。
如果不使用GPU,配置到这里就ok了,就可以使用theano库函数了,如果需要使用GPU,请看下面
ok,以上安装好之后,如果您想使用GPU,那么下面就是GPU的配置了哦。
环境清单:
win7 64位
Anaconda 64位(里面附带的python2.7也是64位的)
Vs2010 (VS2012不知如何,如果哪位用2012配置成功了,告诉我哈)
CUDA5.0 64位(因为在win7 64位环境下,CUDA好像也只能安装64位的;另外要保持和python一样)
下载地址https://developer.nvidia.com/cuda-toolkit-archive
step1:配置好cuda和vs2010,参考链接http://blog.csdn.net/jasonleesjtu/article/details/8454253
step2:配置theano。.theanorc.txt:如下
ldflags=
[gcc]
cxxflags = -IC:\MinGW\include
[nvcc]
flags=-L C:\Anaconda\libs
compiler_bindir= C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
[global]
openmp=False
device = gpu
floatX = float32