python - 使用 python3.6 安装 Tensorflow 失败

标签 python tensorflow

这是我目前的环境

$ 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)   File "/Users/joson/tensorflow/lib/python3.6/imp.py", line 342, in load_dynamic     return _load(spec) 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

最佳答案

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

(请注意,官方不再支持适用于 Mac OS X 的 TensorFlow GPU 版本。)

关于python - 使用 python3.6 安装 Tensorflow 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47485847/

相关文章:

python - 为数据分配编号

python - pandas DataFrame 多个子串匹配,还将一行的特定匹配子串放入新列

image-processing - mobilenet等图像分类模型中如何确定未知类别?

Python函数代码错误

Python-Ldap 库。导入 LDIF

python - TensorFlow 中简单前馈 NN 的 GPU 训练的高效示例实现?也许用 tf.data?

c++ - 在 Tensorflow 中使用 Makefile 选项时出错

python - tensorflow 。将张量的未知维度大小转换为 int

tensorflow - 是否可以将不同的权重子集发送给不同的客户端?

python - matplotlib,占用两个图空间的子图