Created
September 7, 2022 23:54
-
-
Save tiandiao123/c14e8e2ecd21a890ccfae47722f4f6b6 to your computer and use it in GitHub Desktop.
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
| import tensorflow as tf | |
| saved_model_dir = "/Users/cuiqingli123/Workspace/torch_op_exp/mobile_net_v3_small" | |
| # Convert the model | |
| converter = tf.lite.TFLiteConverter.from_saved_model(saved_model_dir) # path to the SavedModel directory | |
| converter.optimizations = [tf.lite.Optimize.DEFAULT] | |
| tflite_model = converter.convert() | |
| # Save the model. | |
| with open('mobile_net_v3_small_dynamic_quantized.tflite', 'wb') as f: | |
| f.write(tflite_model) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment