小编Haz*_*med的帖子

遇到以下问题:Eager 模式不支持 build_tensor_flow

我在玩 TensorFlow,我正在尝试将 Keras 模型导出为 TensorFlow 模型。我遇到了上述错误。我正在关注 Lynda 的“使用 Keras 2.0 构建深度学习应用程序”(https://www.linkedin.com/learning/building-deep-learning-applications-with-keras-2-0/exporting-google-cloud-兼容模型?u=42751868

在尝试构建张量流模型时,我遇到了这个错误,在第 66 行抛出,其中定义了添加元图和变量函数。

第 66 行,在 build_tensor_info 中引发 RuntimeError("build_tensor_info is not supported in Eager mode.") RuntimeError: build_tensor_info is not supported in Eager mode。

...model_builder.add_meta_graph_and_variables(
        K.get_session(),
        tags=[tf.compat.v1.saved_model.tag_constants.SERVING],
        signature_def_map={
            tf.compat.v1.saved_model.signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY: signature_def
        }
    )
...
Run Code Online (Sandbox Code Playgroud)

大家有什么想法吗?

python-3.x keras tensorflow eager-execution tensorflow2.0

6
推荐指数
2
解决办法
1714
查看次数