tensorflow / community

Stores documents used by the TensorFlow developer community
Apache License 2.0
1.26k stars 576 forks source link

tf to tflite conversion showing ambiguous sizes #443

Open AnweshaDeb97 opened 1 year ago

AnweshaDeb97 commented 1 year ago

Whenever I am trying to convert tf to tflite using different optimization techniques, it is showing the same final size. The model sizes I am getting are as follows :- .h5 model size : 711 KB

  1. after pruning+post-quantization : 89 KB (according to https://www.tensorflow.org/model_optimization/guide/pruning/pruning_with_keras , it should create 10x smaller model)
  2. after clustering+post-quantizaion : 89 KB
  3. after post-quantization : 89 KB
  4. after quantize-aware-training : 89 KB

I want to know the reason behind the same final optimized sizes. Even though I am using different optimization techniques, why am I getting the same final .tflite file sizes for different optimizations.

Note : I have also tried optimization using the code provided in examples for pruning, clustering and quantize-aware training on tensorflow website, still seeing the same final size for all optimizations.