saved_model_to_tflite.py
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