Gaurav Reddy
Gaurav Reddy

Reputation: 11

Dtype error when using Mixed Precision and building EfficientNetB0 Model

System information

Error TypeError: Input 'y' of 'Sub' Op has type float16 that does not match type float32 of argument 'x'

Current behaviour

While using Mixed Precision and building a Keras Functional API model (EfficientNet B0), it shows the below error TypeError: Input 'y' of 'Sub' Op has type float16 that does not match type float32 of argument 'x'

Note : For some reason StackOverflow isn't allowing me to post the images. Visit the below link to get more insight over the issue : https://github.com/tensorflow/tensorflow/issues/49725

Expected behaviour

The Global Policy I set in the previous cell was mixed_float16. The problem works fine when running on tensorflow 2.4.1 so the bug is with tensorflow 2.5.0

You can reproduce the same error using the below notebook : https://colab.research.google.com/drive/1TfNZSIJ_I7IZI35RsGFnTdj-6beMHV2_?usp=sharing

Upvotes: 1

Views: 406

Answers (0)

Related Questions