安装tf.js导致numpy == 1.15.1版本出现问题

时间:2019-06-04 05:48:17

标签: python python-3.x

我想将tensorflow.js用于浏览器。当我使用conda虚拟环境在系统(Windows 10 64位,Pycharm社区2019.1)上安装tf.js时,发生以下错误:

(tjfs) A:\modakatech\tjfs>tensorflowjs_converter --version
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-06-03 10:49:29.186367: F tensorflow/python/lib/core/bfloat16.cc:675] 
Check failed: PyBfloat16_Type.tp_base != nullptr

tensorflow.js安装需要软件包numpy==1.15.1keras等。 我试图将numpy升级到最新版本,但是tensorflow.js显示numpy的版本应该是numpy==1.15.1。我当前的numpy版本是1.16,这是不兼容的。

Pycharm Error->ERROR: tensorflowjs 1.1.2 has requirement numpy==1.15.1, but you'll have 
numpy 1.16.4 which is incompatible.

1 个答案:

答案 0 :(得分:0)

您应该卸载numpy

pip uninstall numpy

并安装正确的版本

pip install numpy==1.15.1

编辑: 如果您使用的是conda-要卸载,请使用:

conda remove -n *your_env_name* numpy

要安装特定版本:

conda install -n *your_env_name* numpy=1.15.1