【Python】ImportError: numpy.core.multiarray failed to import

ImportError: numpy.core.multiarray failed to import

使用python,import keras、import numpy、import pickle之后,出现了以下报错:
【Python】ImportError: numpy.core.multiarray failed to import_第1张图片

Using TensorFlow backend.
2021-04-23 12:17:55.357213: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2021-04-23 12:17:55.361915: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
ImportError: DLL load failed: 找不到指定的模块。
ImportError: numpy.core.multiarray failed to import

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 967, in _find_and_load
SystemError: PyEval_EvalFrameEx returned a result with an error set
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2021-04-23 12:17:56.374770: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr

解决方案:
主要原因是某些库的版本依赖出现问题,需要降低numpy的版本:
尝试降到1.12.0:

pip install -U numpy==1.12.0

能够安装,但是版本过低:
【Python】ImportError: numpy.core.multiarray failed to import_第2张图片

降到1.16.0:

pip install -U numpy==1.16.0

【Python】ImportError: numpy.core.multiarray failed to import_第3张图片
【Python】ImportError: numpy.core.multiarray failed to import_第4张图片
问题解决

你可能感兴趣的:(Python,python,numpy,深度学习)