Tflite model has bad accuracy

Hi, I reduced .h5 model size using TFLiteConverter, but the tflite model has a bad accuracy and is not usable. Here is the code I used to reduce the model size. I wanted to know - is there something wrong with reducing the model size code or with the model architecture itself - that it is not possible to reduce the size for this specific model?
I also tested both - .h5 model and .tflite model on 400 images (good and bad quality), but the .tflite model evaluates good quality images the same way as bad quality images.
Here are MAD and RMSE scores:

  • .tflite vs .h5 (images that are in a good quality)
    MAD: 1.8
    RMSE: 1.9
  • tflite vs .h5 (same images but in a bad quality)
    MAD: 0.3
    RMSE: 0.4
    Here are some examples. First MOS score in image name is .h5 result and second one is .tflite result.
    Thank you in advance!


Welcome to the Tensorflow Forum!

Usually the big difference is not expected between tensorflow and tflite. It seems to be a problem and I can see that #59684 is created in github.

Thank you!