当我在 Liclipse 中导入 tensorflow 时,出现以下错误:
Traceback (most recent call last):
File "/home/user/Documents/workspace/project", line 13, in <module>
import tensorflow as tf
File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 45, in <module>
from tensorflow.python import pywrap_tensorflow
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/usr/local/lib/python2.7/dist-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.5: cannot open shared object file: No such file or directory
我已经正确安装了 tensorflow 和 cuda,并且在终端上都可以正常工作。Tensorflow 是通过 pip 安装的,我使用的是 cuda 7.5 和 cuDNN v4,我使用的是 ubuntu 14.04。cuda 样本可以像 Liclipse 之外的 tensorflow 一样完美编译和运行。
我已将 cuda 添加到我的路径和 .bashrc 中的 LD_LIBRARY_PATH 中:
export PATH=/usr/local/cuda-7.5/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:LD_LIBRARY_PATH
我将 Liclipse python 解释器设置为:/usr/bin/python-2.7
任何帮助将非常感激。