tflite形式をMobileアプリ等に組み込む際にInput、Outputのフォーマットを確認する方法
tfliteFormatCheck.py
import tensorflow as tf
interpreter = tf.lite.Interpreter(model_path="my_model.tflite")
interpreter.allocate_tensors()
# Print input shape and type
print(interpreter.get_input_details()[0]['shape'])
print(interpreter.get_input_details()[0]['dtype'])
# Print output shape and type
print(interpreter.get_output_details()[0]['shape'])
print(interpreter.get_output_details()[0]['dtype'])
参考文献
https://firebase.google.com/docs/ml-kit/ios/use-custom-models?hl=ja