-
-
Save akakitani/fd26d489267bea3d00b6db8a4616fced to your computer and use it in GitHub Desktop.
saved_model_to_tflite.py
This file contains 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
graph_def_file = “model_name.pb” | |
input_arrays = [“input_tensor_name”] # this array can have more than one input name if the model requires multiple inputs | |
output_arrays = [“output_tensor_name”] # this array can have more than one input name if the model has multiple outputs | |
converter = lite.TFLiteConverter.from_frozen_graph( | |
graph_def_file, input_arrays, output_arrays) | |
tflite_model = converter.convert() | |
open("converted_model.tflite", "wb").write(tflite_model) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment