1. 安装 AnacondaCE:
下载地址:http://repo.continuum.io/archive/index.html 和 http://repo.continuum.io/anaconda3/
我是win64,选择Anaconda-1.4.0-Windows-x86_64.exe安装
Anaconda会自动安装python.exe和theano的所有依赖项
2. 安装 Theano:
下载地址:https://github.com/Theano/Theano-wininstaller/raw/master/bin/theano_installer_latest.msi
默认安装完成之后,会在cmd的根目录下(打开cmd时显示的目录)生成一个 theanorc_default.txt文件,里面的内容为:
[global] openmp=False [blas] ldflags=
[blas] ldflags = [gcc] cxxflags = -ID:\Anaconda\MinGW [nvcc] fastmath = True flags=-LD:\Anaconda\libs compiler-bindir=D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin base_compiledir=path_to_a_directory_without_such_characters [global] floatX = float32 device = gpu0
3. 配置GPU:
CUDA的配置:http://blog.csdn.net/yeyang911/article/details/17450963
4. 下载DeepLearningTutorials测试代码
下载地址:https://github.com/lisa-lab/DeepLearningTutorials
另外几个链接:【1】 【2】 【3】 官方安装方法:【4】
按照上述安装,theano里除了convolutional_mlp.py以外的所有代码都可以运行,当运行convolutional_mlp.py时出现以下错误:
ValueError: Was not able to allocate output!
WARNING (theano.gof.compilelock): Overriding existing lock by dead process '5216' (I am process '5488')
Error allocating 5760000 bytes of device memory (unknown error).
调试之后发现是theano库中function_module.py代码出现了问题,于是用自己下载的theano-mater中的theano子文件夹(【Theano-master下载】)替换掉theano_installer_latest.msi自动安装的theano(Anaconda\Lib\site-packages\theano),问题解决~~