-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect beta read in Softmax node #3039
Comments
It looks like no matter what input I give, I will get the same output. 0.996094 is equal to the max possible value after dequantizing the outputs. I.e. all outputs are just 127 |
It looks like the Thus, I will henceforth use this thread to discuss the |
I'm trying to run MobileNetV2 on ESP32S3 using the
esp-tflite-micro
framework which is based on thetflite-micro
repository.The model is fully integer quantized and has a size of around 1.8MB.
I have verified that the resulting model works fine through a Python script where it gives same output as the original model.
The problem arises when running on edge. The application fails at
AllocateTensors()
. The issue is in filequantization_util.cc
This function is called by
PreprocessSoftmaxScaling
:-After some debugging, it looks like the value of
input_beta_real_multiplier
is zero because ofbeta
being zero. All other values are non-zero. This shouldn't be the case as when viewed in Netron the node has beta = 1.Now, I decided to instead bypass this by manually replacing beta with 1. This does let the model run with an inference time of around 830ms. The problem then is that the output layer is completely different from that of Python test code.
The output layers has dimensions
1x1000
where each value is a confidence score for a particular label, but in this case all labels get the exact same confidence score.I have uploaded the complete example application on github (includes
esp-tflite-micro
code, Python code and the quantized tflite model).The example contains the modified code for
esp-tflite-micro
(to bypass the beta issue).Check it out here: https://github.com/ShardulNalegave/esp-mbnetv2-test
The text was updated successfully, but these errors were encountered: