gpt4 book ai didi

python - 适用于 Mac 的 TensorFlow : error importing tensorflow

转载 作者:行者123 更新时间:2023-11-30 09:09:26 25 4
gpt4 key购买 nike

我正在尝试在我的 Mac 上使用 TensorFlow。

我在终端中,并遵循 Tensorflow 安装页面上的所有指示,直到“运行一个简短的测试程序”

我正在尝试写

import tensorflow as tf

但是我收到以下消息

RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/__init__.py", line 51, in <module>
from tensorflow.python import pywrap_tensorflow
File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/pywrap_tensorflow.py", line 52, in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/pywrap_tensorflow.py", line 41, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "/Users/robilin/Library/Python/2.7/lib/python/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 28, in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "/Users/robilin/Library/Python/2.7/lib/python/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: numpy.core.multiarray failed to import


Failed to load the native TensorFlow runtime.

任何帮助都会很棒!

最佳答案

您的 numpy 版本似乎不兼容。

您需要升级 numpy

关于python - 适用于 Mac 的 TensorFlow : error importing tensorflow,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43814315/

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