Replace the dynamic int8 file with a weight-only int8 file

#2
by mlboydaisuke - opened
LiteRT Community (FKA TFLite) org

This swaps mobilenet_v3_small_dynamic_wi8_afp32.tflite for a weight-only int8 file built from this repo's own float model, because the dynamic file does not reproduce the float model's predictions (0/6 top-1 on real photos; the weight-only file restores 6/6 at the same size). Same shape as the EfficientNet fix you merged earlier. Nothing here is urgent, and if you would rather keep both files or use a different recipe, that is entirely your call β€” happy to redo it either way.

Details, if useful:

  • Checked against this repo's own mobilenet_v3_small.tflite on six natural images (two photos, plus mirrored and center-cropped variants).
  • dynamic: 0/6 top-1, logit correlation 0.21–0.46. The misses are unrelated classes rather than near ties β€” a cat reads as banded gecko, Christmas stocking, safety pin; a baseball scene as wall clock, jigsaw puzzle.
  • The float file itself is fine: correlation 1.0000 against torchvision's mobilenet_v3_small, so this is the quantization step and not the checkpoint.
  • Likely cause: MobileNetV3's squeeze-excite gates and hard-swish activations have a wide activation range that dynamic-range quantization does not measure. Same shape as the EfficientNet family (SE + SiLU).
  • The replacement is quantized directly from this repo's published mobilenet_v3_small.tflite (sha256 c7a8324a…) with the weight_only_wi8_afp32 recipe: 6/6 top-1, logit correlation 0.9918–0.9938, 2.75 MB against the dynamic file's 2.74 MB (3.7x smaller than float32).
  • README updated to match: the file table row, plus a short "Quantized variant" note in the same wording as the EfficientNet cards.

If it is useful I can run the same check across the other repos that still ship a dynamic_wi8_afp32 file and send whatever it turns up β€” just say the word.

Yoursmiling changed pull request status to merged

This model, because with quantization, may be the answer to those that are implemented.

Sign up or log in to comment