关于ubuntu:ImportError:libcudnn.so.5:无法打开共享对象文件:没有这样的文件或目录,带有Tensorflow-gpu的Python 2.7

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后问题解决了。
干杯!