Fix incorrect TFLite INT8 calibration guidance - #1364
Conversation
7372b8a to
1c35b08
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1364 +/- ##
=======================================
- Coverage 86% 86% -0%
=======================================
Files 111 111
Lines 14292 14290 -2
=======================================
- Hits 12263 12261 -2
Misses 2029 2029 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Corrects TFLite INT8 guidance to reflect dynamic-range quantization behavior.
Changes:
- Removes the inaccurate missing-calibration warning.
- Updates API documentation and export guidance.
- Adjusts regression tests and changelog.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
CHANGELOG.md |
Records the correction. |
docs/learn/export.md |
Revises TFLite INT8 guidance. |
src/rfdetr/detr.py |
Updates public export documentation. |
src/rfdetr/export/main.py |
Clarifies conversion parameters. |
src/rfdetr/export/_tflite/converter.py |
Removes warning and corrects internal documentation. |
tests/export/test_tflite_export.py |
Updates calibration-data tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@amanharshx, I see mostly just doc changes, no code or dependency updates, so you say it was working all the time? I think I tried it and it did not work for me... 😕 |
|
@Borda No, I’m not saying TFLite INT8 always worked end to end. This PR only fixes the calibration guidance. I’ve hit separate export failures too. #1323 fixed the import-order deadlock and shipped in 1.9.3. I also reproduced a 1.9.3 PATH issue on macOS arm64 with Python 3.12, TensorFlow 2.19.1, and onnx2tf 2.4.3: invoking I have a fix and will file it separately with the full reproduction and logs. If what you hit was different, I’d be happy to have a look 🙂 |
1c35b08 to
f9a8442
Compare
|
So let's add a cookbook with TFlite to validate all is fine now |
Dynamic-range quantization derives scales from weights and does not use calibration data. Remove false warning and correct documentation while retaining public API and conversion behavior. Fixes roboflow#1363
The reworded `calibration_data` description said "JPEG/PNG" directories, dropping the BMP and WebP mention the removed section carried. `_load_calibration_images()` matches `_IMAGE_EXTENSIONS`, which is `.jpg`, `.jpeg`, `.png`, `.bmp`, `.webp`, so the shorter list presented supported inputs as unsupported.
f9a8442 to
e571792
Compare
Fixes #1363.
Summary
TFLite
quantization="int8"uses dynamic-range quantization: weights are quantized to INT8, activations remain floating point, and calibration data does not affect the generated models.This PR removes the incorrect missing-calibration accuracy warning and updates the export documentation and docstrings. Public arguments, data preparation, quantization behavior, and static INT8 support remain unchanged.
Validation