gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 15:49:56 26 4
gpt4 key购买 nike

这是我目前的环境

$ 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com