【问题标题】:How to fix "RuntimeWarning: compiletime version 3.6 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.7"?如何修复“RuntimeWarning:模块'tensorflow.python.framework.fast_tensor_util'的编译时版本3.6与运行时版本3.7不匹配”?
【发布时间】:2019-05-02 15:14:14
【问题描述】:

在 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

【问题讨论】:

标签: python tensorflow keras


【解决方案1】:

我遇到了同样的问题。

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

conda update tensorflow

希望对你有帮助!

【讨论】:

  • 所以首先,我的tensorflow是keras自动安装的。 tensorflow 的版本是 v1.13.1,它是 anaconda 云中的最新版本。但我遇到了同样的问题运行时警告。使用 conda update tensorflow 后,版本没有改变,但它确实为我修复了错误。
【解决方案2】:

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

$ 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。

【讨论】:

    猜你喜欢
    • 2012-03-16
    • 2018-04-23
    • 2015-06-26
    • 2022-01-04
    • 2021-07-11
    • 2015-07-07
    • 2020-03-10
    • 2011-09-30
    • 2012-11-21
    相关资源
    最近更新 更多