ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory, Python 2.7 with Tensorflow-gpu

ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory, Python 2.7 with Tensorflow-gpu

安装 Nvidia Quadro M4000 后尝试在 python2.7 上启用 tensorflow-gpu。我收到以下错误消息: 奇怪的是它在抱怨 libcudnn.so.5,但我在 /usr/local/cuda/lib64

中有 libcudnn.so.7

感谢任何建议!

~$ python Python 2.7.13 |Anaconda 4.3.0 (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 tensorflow as tf Traceback (most recent call last): File "", line 1, in File "/usr/local/google/home/hjchai/anaconda2/lib/python2.7/site-packages/tensorflow/init.py", line 24, in from tensorflow.python import * File "/usr/local/google/home/hjchai/anaconda2/lib/python2.7/site-packages/tensorflow/python/init.py", line 49, in from tensorflow.python import pywrap_tensorflow File "/usr/local/google/home/hjchai/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/usr/local/google/home/hjchai/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in from tensorflow.python.pywrap_tensorflow_internal import * File "/usr/local/google/home/hjchai/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/usr/local/google/home/hjchai/anaconda2/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) ImportError: libcudnn.so.5: cannot open shared object file: No such file or directory

无法加载本机 TensorFlow 运行时。

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

出于一些常见原因和解决方案。包括整个堆栈跟踪 寻求帮助时出现此错误消息上方。

更新我自己的解决方案。 原来我安装的是cudnn7.0而不是cudnn5.1。 安装cudnn5.1后问题解决了。 干杯!