升级到tensorflow 2.9时输入ERROR

Nem*_*dám 9 types upgrade keras tensorflow

升级到 tensorflow 2.9 后,使用 tf 2.8 调用 model.fit() 时收到以下错误消息,没有错误。身体总是不舒服,但令人担忧。

2022-06-21 12:42:58.930086: W tensorflow/core/common_runtime/forward_type_inference.cc:231] Type inference failed. This indicates an invalid graph that escaped type checking. Error message: INVALID_ARGUMENT: expected compatible input types, but input 1:
type_id: TFT_OPTIONAL
args {
  type_id: TFT_PRODUCT
  args {
    type_id: TFT_TENSOR
    args {
      type_id: TFT_BOOL
    }
  }
}
 is neither a subtype nor a supertype of the combined inputs preceding it:
type_id: TFT_OPTIONAL
args {
  type_id: TFT_PRODUCT
  args {
    type_id: TFT_TENSOR
    args {
      type_id: TFT_LEGACY_VARIANT
    }
  }
}

    while inferring type of node 'calculate/cond/output/_10'
Run Code Online (Sandbox Code Playgroud)

知道什么可能导致此问题或如何解决它?

小智 4

这应该是评论而不是答案,但我对此没有足够的声誉。我在此处https://www.tensorflow.org/guide/migrate/evaluator和此处https://www.tensorflow.org/guide/migrate/的张量流指南的输出类型中出现了相同类型的错误消息migrating_feature_columns。您可以在点击链接后搜索“类型推断失败”,轻松找到出现错误的行。