如何解决“ RuntimeWarning:模块'tensorflow.python.framework.fast_tensor_util'的编译时版本3.6与运行时版本3.7不匹配?”

时间:2019-05-02 15:14:14

标签: python tensorflow keras

在macOS 10.14.4上导入keras失败,并显示以下错误:

RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.7

2 个答案:

答案 0 :(得分:1)

我遇到了同样的问题。

然后我通过更新tensorflow解决了我的问题:

conda update tensorflow

希望这可以为您提供帮助!

答案 1 :(得分:0)

我正在基于this tutorial on machinelearningmastery设置我的环境(Mac OsX 10.14.4),当我第一次运行deep_versions.py(打印theano,tensorflow和keras的版本)时,我得到了与RuntimeWarning相同的结果OP描述。看起来好像是我运行时安装的版本:

$ conda install theano
...
$ conda install -c conda-forge tensorflow

安装了使用Python 3.6编译的tensorflow版本。我发现this GitHub issue comment from August 2018声称(当时)它们还没有Python 3.7的本地二进制文件。

基于AKAWei's answer in this question,我跑了:

$ conda update tensorflow

这摆脱了RuntimeWarning。