Tensorflow GPU error: ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

Tensorflow GPU error: ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

这是回溯,

>>> import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow import contrib
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/contrib/__init__.py", line 23, in <module>
    from tensorflow.contrib import layers
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/contrib/layers/__init__.py", line 68, in <module>
    from tensorflow.contrib.layers.python.layers import *
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/__init__.py", line 22, in <module>
    from tensorflow.contrib.layers.python.layers.initializers import *
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/contrib/layers/python/layers/initializers.py", line 24, in <module>
    from tensorflow.python.ops import random_ops
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/python/ops/random_ops.py", line 23, in <module>
    from tensorflow.python.framework import ops
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 39, in <module>
    from tensorflow.python.framework import versions
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/python/framework/versions.py", line 22, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/home/eldor4do/tensorflow_gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: libcudart.so.7.0: cannot open shared object file: No such file or directory

这是我的 .bashrc 文件,

export CUDA_HOME=/usr/local/cuda 
export LD_LIBRARY_PATH=${CUDA_HOME}/lib64 

PATH=${CUDA_HOME}/bin:${PATH} 
export PATH 

我正在使用 Ubuntu 15.04、cuda7.5 和 cudnn 4.0.7,并且我在 virtualenv 中使用 pip 安装了 tensorflow。

你的问题是cuda7.5。据我了解,TensorFlow 的链接方式仅适用于 cuda7.0。您要么需要从源代码构建它,要么将您的本地 cuda 版本降级到 7.0(作为一个选项,创建一个 docker 容器并在那里安装较低版本的 cuda,如果您出于其他目的需要 7.5)。