错误(theano.sandbox.gpuarray):无法初始化pygpu,支持禁用
Traceback(最近一次调用最后一次):
文件“/home/mesayantan/.local/lib/python2.7/site-packages/theano/sandbox/gpuarray/ init .py”,第95行,in
init_dev(config.device)
在init_dev中输入文件“/home/mesayantan/.local/lib/python2.7/site-packages/theano/sandbox/gpuarray/ init .py”,第46行
"Make sure Theano and libgpuarray/pygpu "
RuntimeError :('gpuarray的主要API版本错误:', - 9997,'确保Theano和libgpuarray / pygpu同步 . ')
[Elemwise {exp,no_inplace}()]循环1000次占用26.248654秒结果是[1.23178029 1.61879337 1.52278066 ...,2.20771813 2.29967761 1.62323284]使用cpu
2 回答
通过安装theano的开发人员版本解决了这个问题 .
我同意Sayantan Ghosh的观点 .
我使用
git clone https://github.com/Theano/Theano.git cd Theano pip install -e .
在Anaconda中使用了开发者版Theano还有一步是特定的Pygpu库
conda install -c mila-udem pygpu
之后我必须在终端
export THEANO_FLAGS=mode=FAST_RUN,device=cuda,floatX=float32
中放置命令行来解决Old Backend GPU错误 .供您参考,我的环境,Python 3.6,Cuda 9,Cudnn 7