-
-
Save tarun-ssharma/6bbf1ffe1f1276a9603206a177c8fe0c to your computer and use it in GitHub Desktop.
Convert to tflite with randomly picked representative dataset
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load TensorFlow | |
| import tensorflow as tf | |
| # Set up the converter | |
| converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir) | |
| converter.optimizations = [tf.lite.Optimize.OPTIMIZE_FOR_SIZE] | |
| # Perform conversion and output file | |
| tflite_quant_model = converter.convert() | |
| output_dir.write_bytes(tflite_quant_model) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment