目前我的环境
$ pip show tensorflow
Name: tensorflow
Version: 1.4.0
Summary: TensorFlow helps the tensors flow
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource@google.com
License: Apache 2.0
Location: /usr/local/lib/python3.6/site-packages
Requires: wheel, tensorflow-tensorboard, enum34, six, numpy, protobuf
$ pip show protobuf
Name: protobuf
Version: 3.5.0
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: protobuf@googlegroups.com
Author-email: protobuf@googlegroups.com
License: 3-Clause BSD License
Location: /usr/local/lib/python3.6/site-packages
Requires: six, setuptools
$pip show six
Name: six
Version: 1.11.0
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: benjamin@python.org
License: MIT
Location: /usr/local/lib/python3.6/site-packages
Requires:
Traceback(最近一次调用最后一次):文件“”,第1行,in 文件 “/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/init.py” 第24行,在 来自tensorflow.python import *文件“/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/init.py”, 51号线,在 来自tensorflow.python import pywrap_tensorflow文件“/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py”, 第52行 raise ImportError(msg)ImportError:Traceback(最近一次调用最后一次):File “/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py” 第41行,在 来自tensorflow.python.pywrap_tensorflow_internal import *文件“/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py”, 第28行,在 _pywrap_tensorflow_internal = swig_import_helper()文件“/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py”, 第24行,在swig_import_helper中 _mod = imp.load_module('_ pywrap_tensorflow_internal',fp,pathname,description)文件 “/Users/joson/tensorflow/lib/python3.6/imp.py”,第242行,在 load_module return load_dynamic(name,filename,file)文件“/Users/joson/tensorflow/lib/python3.6/imp.py”,第342行,in load_dynamic return _load(spec)ImportError:dlopen(/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10):未加载库:@ rpath / libcublas.8.0.dylib引用自: /Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so 原因:未找到图像
答案 0 :(得分:3)
正如评论中所讨论的,问题是在没有安装CUDA的Mac上安装了用于Mac OS X的TensorFlow的 GPU 版本。卸载并重新安装TensorFlow的CPU版本可以解决问题。
(请注意,不再正式支持适用于Mac OS X的TensorFlow GPU版本。)