星空网 > 软件开发 > 数据库

theano和keras使用过程中遇到的一些问题记录

 

1.使用theano调用relu激活函数提示''It looks like your version of theano is out of date''

bug信息显然是提示更新theano版本,可是一看官网最新版本就是0.7.0,使用pip更新后也提示已经是最新版本。

经过检查后发现,原来theano有两个版本,一个是稳定版,通过 pip install theano获得的就是稳定版,还有一个叫做‘bleeding-edge version’,即最新版,必须通过git更新。
命令如下
pip install git+git://github.com/Theano/Theano.git --upgrade --no-deps
(–no-deps的意思是单独安装theano,各种依赖我已经装好了),注意电脑上必须先装有git.

 

2.内存足够却还是提示内存不足

MemoryError: Error allocating 16777216 bytes of device memory (an illegal memory access was encountered). Apply node that caused the error: GpuElemwise{mul,no_inplace}(CudaNdarrayConstant{error while transferring the value: error copying data to host}, GpuDimShuffle{x,x}.0, image_hidden_w) Inputs types: [CudaNdarrayType(float32, (True, True)), CudaNdarrayType(float32, (True, True)), CudaNdarrayType(float32, matrix)] 

 

方法还是将theano更新到开发者版本

 

记录两个命令:

pip install --upgrade --no-deps git+ git://github.com/fchollet/keras.gitpip install --upgrade --no-deps git+git://github.com/Theano/Theano.git

  分别是更新最新版本theano和keras

调用gpu运行程序

CUDA_LAUNCH_BLOCKING=1 THEANO_FLAGS=device=gpu,floatX=float32,cuda.root=/usr/local/cuda-6.5/ python code.py 




原标题:theano和keras使用过程中遇到的一些问题记录

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

到泰国走什么物流:https://www.goluckyvip.com/tag/88920.html
物流到泰国要多少天:https://www.goluckyvip.com/tag/88921.html
到泰国有哪些物流:https://www.goluckyvip.com/tag/88922.html
什么物流有到泰国:https://www.goluckyvip.com/tag/88923.html
中国到泰国的物流要几天:https://www.goluckyvip.com/tag/88924.html
到泰国物流电话:https://www.goluckyvip.com/tag/88925.html
欧洲B2B电商市场有待挖掘!销售总额将达1.7万亿欧元:https://www.kjdsnews.com/a/1836643.html
​小米汽车只是前菜,雷军的野心绝不止此:https://www.kjdsnews.com/a/1836644.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流