参考文档:1. http://blog.youkuaiyun.com/churximi/article/details/51627849
安装anaconda
- 国内到https://mirror.tuna.tsinghua.edu.cn/下载
更换成国内源,国内源速度快,但不一定稳定
conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' conda config --set show_channel_urls yes
conda install mingw libpython
,theano需要安装mingw和libpythonpip install theano
安装theano
安装cuda
这里安装的cuda8.0,**似乎**5.5版本以上的都可以,只是要有相应的vc版本。具体cuda和vc版本的对应看cuda的安装文档。
根据Nvidia官方Windows cuda8.0安装文档安装。
配置
在C:\Users\JohnsonLai
添加.theanorc.txt
,然后编辑
- CPU版本
[blas]
ldflags =
[gcc]
cxxflags = -IC:\Users\JohnsonLai\Anaconda2\MinGW\x86_64-w64-mingw32\include
- GPU版本
[global]
device = gpu
floatX = float32
openmp=False
[blas]
ldflags =
[gcc]
cxxflags = -IC:\Users\JohnsonLai\Anaconda2\MinGW\x86_64-w64-mingw32\include
[nvcc]
flags = -LC:\Users\JohnsonLai\Anaconda2\libs
compiler_bindir = C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin
测试
import theano.tensor
gpu版本可能会提示一些warning,可能是libgpuarray的,本文还未进行修改。如果没有报error,就对了。