下载
中文
注册
安装TensorFlow 2.6.5后,执行import tensorflow时报错

安装TensorFlow 2.6.5后,执行import tensorflow时报错

2025/03/28

34

暂无评分
我要评分

问题信息

问题来源产品大类产品子类关键字
官方模型训练TensorFlowTensorFlow2.6.5、import tensorflow、RuntimeError

问题现象描述

安装TensorFlow 2.6.5后,执行import tensorflow时报错:“RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd”。

放大

可能原因

pip3安装TensorFlow的时候,可能会自动重装numpy,导致TensorFlow和numpy版本不兼容,需用户手动重装numpy。

解决措施

执行如下命令卸载旧版本numpy,安装TensorFlow 2.6.5适配的numpy 1.23.0版本。

pip3 uninstall numpy
pip3 install numpy==1.23.0

本页内容