-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Problems evaluating INT8 quantized TFLite
model
#1638
Comments
Btw, I see quite a lot of people asking about exported model results so I though I could post mine here. I exported them with the
|
TFLite
model
For anybody interested in why this is the case, we are discussing this here: https://github.com/PINTO0309/onnx2tf/issues/244 |
This seems to be a known critical TF issue. Basically all quantized models don't work when exporting to TFLite by: PyTorch -- (torch.onnx.export) --> ONNX -- (onnx2tf v onnx-tf) --> TFlite. Not sure if this is only the case for model exported by this pipeline or if it is in general. Maybe somebody knows? |
Since Float32 is working fine, it is odd that only the INT8 model would break if the Keras model object used to generate the INT8 model in the backend of the tool is the same. YOLOv8 broke the same way. Thus, I can even presume that it is not a conversion flow issue. |
Thanks for the insights @PINTO0309 😄 |
For the benefit of other engineers' knowledge, I will also post in this thread the workaround needed to eliminate the accuracy degradation due to quantization. It seems that we need to rethink the activation function, etc. significantly and redefine another YOLOX-alpha like model that is not YOLOX to make it work. Thus, differences in the route of conversion were not related to accuracy degradation. It is a matter of model structure. The activation function, kernel size and stride for
|
This got solved here: PINTO0309/onnx2tf#269. Closing this down! |
I have managed to generate :
dynamic_range_quant
,full_integer_quant
andinteger_quant
versions of the TFLite model using onn2tf. However the postprocessing fails for some reason. The confidences are so low that none of the predictions passes through the filtering. Any idea what could be the problem? Thefloat16
andfloat32
TFLite models works as usual, achieving the result in the table below. Anybody triedonn2tf
and got the models working?The text was updated successfully, but these errors were encountered: