Theono版本引起的错误

使用nematus需要用到theano环境,但是运行时theano报了各种错误。

其中一部分是cudnn导致的,在我的另一篇博客[ubuntu上的cudnn安装及使用报错解决办法]中有提到。还有一部分是theano版本引起的。

运行报错:

AttributeError: 'module' object has no attribute 'tests'

看教程里的解决办法是将theano版本安装为0.8.2

pip/conda install Theano==0.8.2

但是替换为0.8.2之后运行仍然报错

RuntimeError: ('Wrong major API version for gpuarray:', 2, 'Make sure Theano and libgpuarray/pygpu are in sync.')

解决办法:
安装developer版本的Theano

git clone https://github.com/Theano/Theano.git
cd Theano
pip install -e .

theano使用gpu运行需要安装Pygpu库

conda install -c mila-udem pygpu

执行时使用export THEANO_FLAGS=mode=FAST_RUN,device=cuda,floatX=float32
可以解决Old Backend GPU error

以下报错

RuntimeError: You can't initialize the GPU in a subprocess if the parent process already did it

是v1.0.1版本theano的问题,使用旧版本v1.0.0及更早版本不会报错。

安装方法

git clone https://github.com/Theano/Theano.git
git checkout -b rel-1.0.0
cd Theano
pip install -e .
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值