Jupyter Noteb中Tensorflow的导入错误

2024-04-26 12:19:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我的电脑里安装了水蟒。我已经在里面安装了tensorflow的所有模块。我试图从jupyter笔记本导入tensorflow,但我得到以下错误。在

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
RuntimeError: module compiled against API version 0xb but this version of numpy is 0xa

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.multiarray failed to import

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.umath failed to import

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
ImportError: numpy.core.umath failed to import

有人能帮我解决这个错误吗?在


Tags: tocoreimportnumpymostversiontensorflow错误
2条回答

更新numpy库时出错。在

我用following命令升级了numpy

pip install numpy  upgrade

问题解决了。在

enter image description here

从回溯来看,由于当前版本的numpy与Tensorflow不兼容,因此会引发导入错误。更新numpy包应该可以解决这个问题。在

在Python提示中尝试以下操作:

conda update numpy

有用链接:

相关问题 更多 >