配置theano lasagne 和 g++加速

在prompt端输入:

需要提前安装以下包:
conda install numpy scipy
安装 theano

pip install --upgrade https://github.com/Theano/Theano/archive/master.zip

安装 lasagne

pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip

如果直接 conda install lasagne,那么多半会出现以下问题:
You can find the C code in this temporary file: c:\users\54719\appdata\local\temp\theano_compilation_error_5qddr3
library blas is not found
。。。
Exception: (‘The following error happened while compiling the node’, Dot22(<TensorType(float64, matrix)>, W), ‘\n’, 'Compilation failed (return status=1): D:/Anaconda3/envs/python27/Library/mingw-w64/bin/…/lib/gcc/x86_64-w64-mingw32/5.3.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: cannot find -lblas\r. collect2.exe: error: ld returned 1 exit status\r. ',

这是因为theano有三种运行方式–依托于numpy的mkl、cpu(g++)、gpu,用conda安装theano时,会默认把m2w64-toolchain(包含g++)装上,导致不能在numpy上运行。

解决办法

为了成功让运行g++提速,我们要:

#没安装过m2w64-toolchain的请把那个也安装下
conda install mingw libpython

在c:\users\54719\找到.theanorc.txt,这个文件,把里面的內容修改成:

[global]
openmp=False
[blas]
ldflags =
[gcc]
cxxflags = -ID:\Anaconda3\envs\last\MinGW

(MinGW包在D:\Anaconda3\envs\last\MinGW里)

然后就好了

如果想要gpu加速,请参阅:https://blog.csdn.net/deepstem/article/details/77170109

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

学渣渣渣渣渣

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值