LoginSignup
5
5

More than 5 years have passed since last update.

tfliteファイルの入力、出力フォーマット確認方法

Last updated at Posted at 2019-03-10

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

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5