Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Type ERROR when upgrading to tensorflow 2.9

After upgrading to tensorflow 2.9 I got the following Erro message when calling model.fit() with tf 2.8 there were no error. The fit runs anways but its worrying.

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'

Any idea what can cause this or how to fix it?

like image 631
Nemes Gyula Ádám Avatar asked May 01 '26 01:05

Nemes Gyula Ádám


1 Answers

This should be a comment instead of an answer, but I don't have enough reputation for that. I have seen the same type of error message appear in the output type of the tensorflow guide here https://www.tensorflow.org/guide/migrate/evaluator and here https://www.tensorflow.org/guide/migrate/migrating_feature_columns . You can easily find the lines with the error by searching for "type inference failed" after following the links.

like image 180
mirko Avatar answered May 03 '26 16:05

mirko