Three ways to shrink a model 4–10×
The tf.lite.TFLiteConverter has three factory methods: from_saved_model (recommended), from_keras_model, and from_concrete_functions. The SavedModel path produces the most complete and optimized conversion.
The three quantization tiers, each smaller and faster than the last:
- None (float32 baseline) — direct conversion, no size reduction. Same accuracy as the original.
- Dynamic range (
optimizations=[tf.lite.Optimize.DEFAULT]) — weights statically quantized to int8, activations quantized at runtime. ~4× smaller, 2–3× faster CPU. No calibration data needed. Easiest first step. - Full integer (int8) — both weights AND activations as int8. Requires a representative dataset (100–200 samples) to calibrate activation ranges. ~4× smaller, 3×+ faster. Required for Edge TPU and microcontrollers.