J'essaie d'installer Tensorflow avec prise en charge du processeur graphique sur Ubuntu 16.04 64x pour un environnement conda avec Python 3.6.
J'ai essayé d'installer tous les configuration requise du processeur graphique puis de lancer pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.10.0-cp36-cp36m-linux_x86_64.whl
à partir de mon environnement Conda.
Cependant, lorsque j'ouvre un terminal Python et que j'essaie import tensorflow as tf
, je reçois un ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
.
C'est l'état des exigences:
nvidia-smi
)release 7.5, V7.5.17
(en sortie de nvcc -v
)cat /usr/local/cuda/version.txt
). Je suis vraiment confus parce que j'ai lu quelque part que la version CUDA et la version nvcc devraient correspondre.Sudo dpkg -i /path/to/deb/file
suivi de Sudo apt-get install -f
. Mais Internet me dit que l’exécution de cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
devrait me donner la version de CUDNN et il se plaint que le fichier n’existe pas.export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64
comme indiqué dans le guide des exigences de tensorflow.Que devrais-je essayer maintenant?
Trace d'erreur complète:
>>> import tensorflow
Traceback (most recent call last):
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/__init__.py", line 49, in <module>
from tensorflow.python import pywrap_tensorflow
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 74, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "/home/jsevillamol/anaconda3/envs/ctlearn/lib/python3.6/imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
Cuda 9.0 peut être installé avec les codes du tutoriel suivant
https://www.tensorflow.org/install/gp
# Add NVIDIA package repository
Sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_AMD64.deb
Sudo apt install ./cuda-repo-ubuntu1604_9.1.85-1_AMD64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/nvidia-machine-learning-repo-ubuntu1604_1.0.0-1_AMD64.deb
Sudo apt install ./nvidia-machine-learning-repo-ubuntu1604_1.0.0-1_AMD64.deb
Sudo apt update
# Install CUDA and tools. Include optional NCCL 2.x
Sudo apt install cuda9.0 cuda-cublas-9-0 cuda-cufft-9-0 cuda-curand-9-0 \
cuda-cusolver-9-0 cuda-cusparse-9-0 libcudnn7=7.2.1.38-1+cuda9.0 \
libnccl2=2.2.13-1+cuda9.0 cuda-command-line-tools-9-0
# Optional: Install the TensorRT runtime (must be after CUDA install)
Sudo apt update
Sudo apt install libnvinfer4=4.1.2-1+cuda9.0
Fixé! Il s'avère que la distribution TF installée par défaut ne prend pas en charge CUDA 9.2. J'ai rétrogradé à CUDA 9.0 et maintenant, il fonctionne provisoirement.