No module named 'numpy.core._multiarray_umath'

 

安装 tensorflow后出现如下错误:

Using TensorFlow backend.
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 "", line 968, in _find_and_load
SystemError: returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-04-16 10:03:27.752371: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr 

或者提示:

AttributeError: module 'tensorflow' has no attribute 'constant'

原因:

numpy和tensorflow版本不兼容

解决办法:

1、升级numpy

2、降低tensorflow版本

我用的是numpy1.15.3

tensorflow是1.12.0

这样就可以解决问题了!注意!千万别使用太新版本的tensorflow,有好多都不兼容!

 

 

你可能感兴趣的:(python笔记)