【发布时间】:2017-10-26 15:23:29
【问题描述】:
我正在尝试在虚拟环境中使用带有 Theano 后端的 Keras。我得到的错误是:
错误(theano.sandbox.cuda):编译cuda_ndarray.cu失败:libcublas.so.7.5:无法打开共享对象文件:没有这样的文件或目录
此处显示:
(hyperproj) $ python
>> import theano
ERROR (theano.sandbox.cuda): Failed to compile cuda_ndarray.cu: libcublas.so.7.5: cannot open shared object file: No such file or directory
WARNING (theano.sandbox.cuda): The cuda backend is deprecated and will be removed in the next release (v0.10). Please switch to the gpuarray backend. You can get more information about how to switch at this URL:
https://github.com/Theano/Theano/wiki/Converting-to-the-new-gpu-back-end%28gpuarray%29
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu0 is not available (error: cuda unavailable)
这是我到目前为止所做的:
$ screen
$ conda create -n hyperproj python=2.7 anaconda
$ source activate hyperproj
(hyperproj) $ conda install numpy
(hyperproj) $ conda install keras
(hyperproj) $ conda install theano
(hyperproj) $ cd $HOME
(hyperproj) $ cd .keras/
(hyperproj) $ vim keras.json
这就是keras.json现在的样子(我把tensorflow后端改成了theano后端):
{
"image_dim_ordering": "th",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "theano"
}
我需要修改(或创建)我的 .theanorc 文件:
(hyperproj) $ vim ~/.theanorc
经过几次教程,看起来是这样的:
[global]
floatX=float32
device=gpu0
[nvcc]
fastmath=True
[cuda]
root = /usr/local/cuda-7.5
有人说我可能需要检查我的 .bashrc 文件并修改我的 $PATH。这是现在的样子(例如,在this 之后):
# Added by Canopy installer on 2016-06-20
# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that Canopy is active, otherwise 1
VIRTUAL_ENV_DISABLE_PROMPT=1 source /mnt/data/user/pkgs/enthought/canopy-1.5.1/bin/activate
# added by Anaconda2 2.5.0 installer
export PATH="/export/mlrg/user/anaconda2/bin:$PATH"
# added by Anaconda2 4.1.1 installer
export PATH="/mnt/data/user/pkgs/anaconda2/bin:$PATH"
#added to fix the theano libcudnn issue
export PATH=/usr/local/cuda/bin:/usr/local/cuda/lib64:$PATH
export LD_LIBRARY_PATH="/usr/local/cuda/lib64/:$LD_LIBRARY_PATH
我有 CUDA 7.5、Ubuntu 14.04、g++ 版本 4.8.4。
我该如何解决这个错误?
【问题讨论】:
标签: python keras theano theano-cuda