【发布时间】:2017-08-03 01:09:33
【问题描述】:
在配备四核 I7 和 NVIDIA GeForce GT 650M 的 Macbook Pro 上运行。
从 virtualenv 运行 Tensorflow 时收到此错误消息。我做错了什么?我正在使用 protobuf 版本 3.2.0
{
(tensorflow) m:src sm$ python
Python 2.7.10 (default, Jul 13 2015, 12:05:58)
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/smahesh/src/tensorflow/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Users/smahesh/src/tensorflow/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 72, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Users/smahesh/src/tensorflow/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 61, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Users/smahesh/src/tensorflow/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
_pywrap_tensorflow = swig_import_helper()
File "/Users/smahesh/src/tensorflow/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: dlopen(/Users/smahesh/src/tensorflow/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: @rpath/libcudart.8.0.dylib
Referenced from: /Users/smahesh/src/tensorflow/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
Reason: image not found
Failed to load the native TensorFlow runtime.
See https://github.com/tensorflow/tensorflow/blob/master/tensorflow/g3doc/get_started/os_setup.md#import_error
}
【问题讨论】:
-
你用的是mac吗?
-
您是否阅读了错误消息中给出的链接中的说明?
-
可能你使用的是你的 macine 不支持的 -gpu 库
-
我也有同样的问题。我已经在 Debian 机器上安装了带有原生 pip 的 Tensorflow,并且安装运行成功。但是,当我尝试在 python 中导入 Tensorflow 时,出现此错误。 (链接处的github页面没有找到!)
标签: python tensorflow virtualenv