gpt4 book ai didi

python - 模块未找到错误 : No module named 'numpy.core._multiarray_umath' (While installing TensorFlow)

转载 作者:太空狗 更新时间:2023-10-29 18:19:45 27 4
gpt4 key购买 nike

我正在按照本教程安装 TensorFlow(https://www.tensorflow.org/install/pip),但在最后一个命令中:

python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

我得到这个结果:

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 980, in _find_and_load
SystemError: <class '_frozen_importlib._ModuleLockManager'> returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-02-16 12:56:50.178364: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr

如您所见,我已经安装了 numpy:

pip3 install numpy
Requirement already satisfied: numpy in c:\programdata\anaconda3\lib\site-packages (1.15.4)

那么为什么我会收到此错误消息,我该如何在 Windows 10 上修复它?

最佳答案

我将 numpy 升级到 1.16.1 版本并再次尝试上面的命令:

python -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"

并得到了这个新结果:

2019-02-16 13:12:40.611105: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
tf.Tensor(-1714.2305, shape=(), dtype=float32)

关于python - 模块未找到错误 : No module named 'numpy.core._multiarray_umath' (While installing TensorFlow),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54721703/

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