TensorFlow-ModuleNotFoundError:没有名为'numpy.core._multiarray_umath'的模块

时间:2019-09-23 19:48:02

标签: python numpy tensorflow pip

在第一个时期开始时获取ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'。所有模块(即tensorflownumpy等)都是最新的。

p.s。 here for another question发布的所有答案都不适用于我。所以我创建了一个新问题。

软件堆栈:

OS: Windows 10 1903
Python: 3.7.4
TensorFlow: 1.14.0
numpy: 1.17.2

完整错误堆栈跟踪:

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
2019-09-23 22:41:24.328882: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr 
Using TensorFlow backend.
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
Exception in thread Thread-72:
Traceback (most recent call last):
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\PyCharmProjects\fer\venv\lib\site-packages\keras\utils\data_utils.py", line 572, in _run
    with closing(self.executor_fn(_SHARED_SEQUENCES)) as executor:
  File "D:\PyCharmProjects\fer\venv\lib\site-packages\keras\utils\data_utils.py", line 554, in <lambda>
    initargs=(seqs,))
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 119, in Pool
    context=self.get_context())
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 176, in __init__
    self._repopulate_pool()
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 241, in _repopulate_pool
    w.start()
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 112, in start
    self._popen = self._Popen(self)
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\popen_spawn_win32.py", line 89, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle _thread.lock objects

Exception in thread Thread-74:
Traceback (most recent call last):
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\PyCharmProjects\fer\venv\lib\site-packages\keras\utils\data_utils.py", line 572, in _run
    with closing(self.executor_fn(_SHARED_SEQUENCES)) as executor:
  File "D:\PyCharmProjects\fer\venv\lib\site-packages\keras\utils\data_utils.py", line 554, in <lambda>
    initargs=(seqs,))
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 119, in Pool
    context=self.get_context())
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 176, in __init__
    self._repopulate_pool()
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\pool.py", line 241, in _repopulate_pool
    w.start()
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py", line 112, in start
    self._popen = self._Popen(self)
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py", line 322, in _Popen
    return Popen(process_obj)
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\popen_spawn_win32.py", line 89, in __init__
    reduction.dump(process_obj, to_child)
  File "C:\Users\talha\AppData\Local\Programs\Python\Python37\lib\multiprocessing\reduction.py", line 60, in dump
    ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle _thread.lock objects

2019-09-23 22:41:25.141774: F tensorflow/python/lib/core/bfloat16.cc:675] Check failed: PyBfloat16_Type.tp_base != nullptr 

1 个答案:

答案 0 :(得分:0)

我有同样的问题。关注了此链接https://github.com/numpy/numpy/issues/12977

pip uninstall numpy
conda install numpy