1.安装anaconda
地址:http://www.continuum.io/downloads
2.安装mingw
cmd输入:conda install mingw libpython
3.环境配置
在用户变量中,PATH添加C:\Anaconda;C:\Anaconda\Scripts;
并新建 PYTHONPATH:C:\Anaconda\Lib\site-packages\theano;
在cmd的home目录中新建 .theanorc.txt 文件(注意名字中的“.”),根据自己安装MinGW的路径写上MinGW的路径,我的如下:
[blas]
ldflags=
[gcc]
cxxflags = -IC:\Anaconda\MinGW
重启电脑
4.安装theano
cmd输入:pip install theano
装完之后在ipython中输入以下两行代码测试一下:
import theano
theano.test()
没有error的话,恭喜你,安装成功了
5.GPU加速
GPU加速首先就是安装CUDA,然而CUDA只支持NVIDIA显卡,因为CUDA软件就是他家出的,
如果你的本并不是NVIDIA显卡,别费劲了
6.BLAS
看看numpy是不是已经默认BLAS加速了,在python里输入:
import numpy
id(numpy.dot) == id(numpy.core.multiarray.dot)
结果为False表示已经成功依赖了BLAS加速,如果是Ture则表示用的是python自己的实现,并没有加速。
参考 http://deeplearning.net/software/theano/install.html#install
http://blog.sina.com.cn/s/blog_96b836170102vq22.html