Bad results on Android

Hi everyone
I have very bad results on android, though my tflite model on PC works good
My Softmax on Android gives 1. or 0.
Without Softmax on Android max value 9.13 and on Android 21000.13, I can’t understand why results are so different
Am I doing something wrong?

1 Like

Hi @Nazar_Pankov,

  • The reason for difference in results between PC and android might be due to input data format and type of quantization used. Make sure that the same input data preprocessing steps are applied to the model on both the environments. Choose the tflite quantization method based on the availability of memory(CPU or GPU) on your android environment. The type of quantization used on different platforms effects the results. Check different quantization methods compatibility with Hardware.

  • Obviously the model output is different with and without using softmax layer. This layer is crucial for normalizing the output values into probabilities, ensuring that they fall between 0 and 1. Without Softmax, the raw output values can be very large or very small, making them difficult to interpret as probabilities. This might be the reason for your usecase.

For further assistance, could you please post this on gogle-ai-edge/liteRT repo.

Thank You