2017-05-25 4 views
0

Ich versuche Keras mit dem Theano-Backend in einer virtuellen Umgebung zu verwenden. Der Fehler Ich erhalte ist:Theano for Keras: Kompilieren nicht möglich cuda_darray.cu: libcublas.so.7.5: Gemeinsame Objektdatei kann nicht geöffnet werden: Keine solche Datei oder Verzeichnis

ERROR (theano.sandbox.cuda): Fehler cuda_ndarray.cu kompilieren: libcublas.so.7.5: kann nicht mit anderen geteilt Objektdatei öffnen: Datei oder das Verzeichnis

gezeigt hier:

(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) 

das ist, was ich bisher getan habe:

$ 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 

Dies ist, was keras.json jetzt aussieht (änderte ich das tensorflow Backend zum Theanos Backend):

{ 
    "image_dim_ordering": "th", 
    "epsilon": 1e-07, 
    "floatx": "float32", 
    "backend": "theano" 
} 

Ich brauche zu ändern (oder erstellen) meine .theanorc Datei:

(hyperproj) $ vim ~/.theanorc 

Nach mehreren Tutorials, es sieht wie folgt aus:

[global] 
floatX=float32 
device=gpu0 

[nvcc] 
fastmath=True 

[cuda] 
root = /usr/local/cuda-7.5 

Jemand sagte, ich muss möglicherweise überprüfen Meine .bashrc-Datei und ändern Sie meine $ PATH. Hier ist, wie das aussieht jetzt (nach dem zum Beispiel 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 

Ich habe CUDA 7.5, Ubuntu 14.04, g ++ Version 4.8.4.

Wie kann ich den Fehler beheben?

Antwort

0

Seltsamerweise wurde das Problem durch Abmelden und erneutes Anmelden behoben. Als ich mich anmeldete, tat ich folgendes:

$ screen 
$ source activate hyperproj 
(hyperproj) $ which nvcC#gave me /usr/local/cuda/bin/nvcc 
(hyperproj) $ cd /usr/local/cuda/lib64 #checked that I have libcublas.so 
(hyperproj) $ cd $HOME 
(hyperproj) $ python 
Python 2.7.13 |Anaconda custom (64-bit)| (default, Dec 20 2016, 23:09:15) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
Anaconda is brought to you by Continuum Analytics. 
Please check out: http://continuum.io/thanks and https://anaconda.org 
>>> import keras 
Using Theano backend. 
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 

Using gpu device 0: GeForce GTX TITAN Black (CNMeM is disabled, cuDNN not available) 
Verwandte Themen