ValueError: You are trying to use the old GPU back-end. It was removed from Theano. Use device=cuda*

版权声明:卢克治-北京交通大学-NLP https://blog.csdn.net/qq_31747765/article/details/81665957

在使用theano利用gpu跑python程序的时候报错如下:

ValueError: You are trying to use the old GPU back-end. It was removed from Theano. Use device=cuda* now. See https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29 for more information.

解决方法:
1: vim ~/.bashrc
2:添加如下命令:

export THEANO_FLAGS='mode=FAST_RUN,device=cpu,floatX=float32'

3:使修改的theano设置生效:

source ~/.bashrc

4:编辑theano对于gpu的配置文件:

vim ~/.theanorc

5:添加内容如下:

[global]
device = cuda
floatX=float32
[nvcc]
flags=--machine=64
[lib]
cnmem=100

结束

猜你喜欢

转载自blog.csdn.net/qq_31747765/article/details/81665957