Skip to content

Instantly share code, notes, and snippets.

@tiandiao123
Created November 9, 2022 00:05
Show Gist options
  • Select an option

  • Save tiandiao123/28c7f1280f96c413edc4227a2df3d6ce to your computer and use it in GitHub Desktop.

Select an option

Save tiandiao123/28c7f1280f96c413edc4227a2df3d6ce to your computer and use it in GitHub Desktop.
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()
interpreter = tf.lite.Interpreter(model_content=tflite_model)
all_tensors = interpreter.get_tensor_details()
for tensor_layer_info in all_tensors:
print(tensor_layer_info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment