Home > other >  Install tensorflow - gpu ImportError: libcudnn. So. 7: always open a Shared object file: No
Install tensorflow - gpu ImportError: libcudnn. So. 7: always open a Shared object file: No

Time:10-11

Linux system, python3.6, installed cuda, and cudnn7.1.2, and tensorflow - gpu, run the following
 & gt;> The import tensorflow as tf 
Traceback (the most recent call last) :
The File "/home/serlon/local/lib/python3.6/site - packages/tensorflow/python/pywrap_tensorflow py", 58, line in & lt; module>
The from tensorflow. Python. Pywrap_tensorflow_internal import *
The File "/home/serlon/local/lib/python3.6/site - packages/tensorflow/python/pywrap_tensorflow_internal py", 28, the line in & lt; module>
_pywrap_tensorflow_internal=swig_import_helper ()
The File "/home/serlon/local/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, the pathname, description)
The File "/usr/lib/python3.6/imp. Py", line 243, in the load_module
Return load_dynamic (name, filename, file)
The File "/usr/lib/python3.6/imp. Py", line 343, in load_dynamic
Return _load (spec)
ImportError: libcudnn. So. 7: always open a Shared object file: No to the file or directory

During handling of the above exception, another exception occurred:

Traceback (the most recent call last) :
The File "& lt; Stdin>" , the line 1, the in & lt; module>
The File "/home/serlon/local/lib/python3.6/site - packages/tensorflow/set py", line 22, in & lt; module>
The from tensorflow. Python import pywrap_tensorflow # pylint: disable=unused - import
The File "/home/serlon/local/lib/python3.6/site - packages/tensorflow/python/set py", line 49, in & lt; module>
The from tensorflow. Python import pywrap_tensorflow
The File "/home/serlon/local/lib/python3.6/site - packages/tensorflow/python/pywrap_tensorflow py", line 74, in & lt; module>
Raise ImportError (MSG)
ImportError: Traceback (the most recent call last) :
The File "/home/serlon/local/lib/python3.6/site - packages/tensorflow/python/pywrap_tensorflow py", 58, line in & lt; module>
The from tensorflow. Python. Pywrap_tensorflow_internal import *
The File "/home/serlon/local/lib/python3.6/site - packages/tensorflow/python/pywrap_tensorflow_internal py", 28, the line in & lt; module>
_pywrap_tensorflow_internal=swig_import_helper ()
The File "/home/serlon/local/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, the pathname, description)
The File "/usr/lib/python3.6/imp. Py", line 243, in the load_module
Return load_dynamic (name, filename, file)
The File "/usr/lib/python3.6/imp. Py", line 343, in load_dynamic
Return _load (spec)
ImportError: libcudnn. So. 7: always open a Shared object file: No to the file or directory


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

For some common having and solutions. Include the - stack trace
Above this error message when have for help.

And the files in/usr/local/obviously cuda/lib64
 serlon @ serlon - System - the Product - Name:/$echo $LD_LIBRARY_PATH 
/usr/local/cuda/lib64

 serlon @ serlon - System - the Product - Name: $ll/usr/local/cuda/lib64/| grep libcudnn 
13 July 26 04:43 LRWXRWXRWX 1 root root libcudnn. So - & gt; 7 *
libcudnn. So.17 July 26 04:42 LRWXRWXRWX 1 root root libcudnn. So. 7 - & gt; Libcudnn. So. 7.1.2 *
- rwxr-xr-x mto 1 root root 330735920 July 26 04:37 libcudnn. So. 7.1.2 *
Rw - r - r - 1 root root 327412782 July 26 04:37 libcudnn_static. A


CodePudding user response:

Bloggers, may I have your problem solved

CodePudding user response:

to learn how to search, as long as the key line of the error message, to search for, can find the answer, 80%
an error message is clearly missing file (library) rely on



Try the following method,

  • Related