win7 安装theano+gpu

参考 http://deeplearning.net/software/theano/install_windows.html

至于theano的安装是比较简答的,可以选择集成的安装包(如:WinPython、Anaconda等),也可以使用python自带的命令pip安装。(Python的安装路径上不能有空格,否则会给后续的配置带来麻烦)

要使用GPU,系统还需安装CUDA驱动。两者都安装好之后,接下来就是要配置theano,使其能用上GPU

在C:\Users\<User name>\ (所谓的Home,或根目录)下建立一个文件 .theanorc.txt 里面复制如下内容:

[blas]
ldflags = 
[gcc]
cxxflags = 

[nvcc]
fastmath = True

[global]
device = gpu
floatX = float32

如果要详细配置各个编程参数,可如下配置:

[blas]
ldflags=
[gcc]
cxxflags = -ID:\WinPython-2.7.10.3\python-2.7.10.amd64\include

[nvcc]
fastmath = True
--flags=-LD:\WinPython-2.7.10.3\python-2.7.10.amd64\libs
--compiler_bindir=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\
[global]
device = gpu
floatX = float32
openmp = False


 

 

但在配置这个文件时,要特别注意gcc.cxxflags和nvcc.flags的路径中不能有空格,否则编译会出错。也就是Python的安装路径中不要含空格。

使用WinPython的,配置GPU时要注意配置文件的存放路径:

Configure Theano for GPU use

Theano can be configured with a .theanorc text file (or .theanorc.txt, whichever is easier for you to create under Windows). It should be placed in the directory pointed to by the %USERPROFILE% variable. Please note, that WinPython changes it to WinPythonDir\settings (so in our system this corresponds to D:\WinPython-2.7.10.3\settings.

To use the GPU please write the following configuration file:

[global]
device = gpu
floatX = float32

[nvcc]
flags = --use-local-env  --cl-version=2008

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值