为什么我不能在Mac上导入tensorflow-gpu?

时间:2018-09-16 23:16:19

标签: python macos tensorflow gpu

我是刚开始在这里发布信息的人,所以如果我搞砸了,请原谅我。我已经尝试了很长时间在Mac OS 10.12.6上安装具有gpu支持的tensorflow。我知道Tensorflow for Mac支持从版本1.2开始被删除。我正在安装1.1.0版。我能够安装此版本,但是,当我尝试导入张量流时,得到以下堆栈跟踪:

import tensorflow as tf

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
  File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
  File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
  File "/Users/workhorse/tensorflow-gpu/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: dlopen(/Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib
  Referenced from: /Users/workhorse/tensorflow-gpu/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so
  Reason: image not found


Failed to load the native TensorFlow runtime.

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

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

我检查了常见原因,但没有人提及我的原因。谢谢您的时间和帮助!

1 个答案:

答案 0 :(得分:0)

根据GitHub URL,看来可能存在修复程序here

根据其中一位用户,这似乎是一个受欢迎的答案:

The following user "yaroslavvb" provided this answer not me

我刚刚进行了一些研究,但我并没有真正为您的答案提供任何见解,希望对您有所帮助。