使用Python3.6安装Tensorflow失败

3

这是我目前的环境

$ 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 (most recent call last): File "", line 1, in File "/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/init.py", line 24, in from tensorflow.python import * File "/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/init.py", line 51, in from tensorflow.python import pywrap_tensorflow File "/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in raise ImportError(msg) ImportError: Traceback (most recent call last): File "/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in from tensorflow.python.pywrap_tensorflow_internal import * File "/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in _pywrap_tensorflow_internal = swig_import_helper() File "/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 24, in swig_import_helper _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description) File "/Users/joson/tensorflow/lib/python3.6/imp.py", line 242, in load_module return load_dynamic(name, filename, file) ImportError: dlopen(/Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so, 10): Library not loaded: @rpath/libcublas.8.0.dylib Referenced from: /Users/joson/tensorflow/lib/python3.6/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so Reason: image not found

真的,我不知道你想说什么,请说明你的问题。是你安装了tensorflow但它在你的系统上无法工作吗? - Panna Das
在我的 Mac 上,输入 >>> import tensorflow as tf 后,无法加载本机 TensorFlow 运行时。 - Joson
看起来它正在尝试查找libcublas.8.0.dylib。您是否已安装CUDA?您用什么命令安装TensorFlow? - MatthewScarpino
请按照以下步骤使用Virtualenv安装TensorFlow:https://www.tensorflow.org/install/install_mac。@MatthewScarpino - Joson
如果你只是安装普通的TensorFlow,应用程序寻找CUDA是很奇怪的。如果你只运行pip install tensorflow会发生什么? - MatthewScarpino
显示剩余4条评论
1个回答

4

如评论中所讨论的那样,问题在于在没有安装CUDA的Mac上安装了Mac OS X版本的GPU TensorFlow。卸载并重新安装TensorFlow的CPU版本应该可以解决这个问题。

(请注意,Mac OS X的GPU TensorFlow版本已不再得到官方支持。)


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接