How to get input shape from frozen inference graph for tflite conversion

Viewed 281

I'm a newbie in programming and I would like to ask how to get the input shape from a frozen inference graph which I will be using to convert it in tflite format. Do you have any command lines or code to determine it just like in determining the input and output arrays? I will put the resulting input shape in this part of the code {'image_tensor' : [1, image_size, image_size, 3]}. Any answers will be much appreciated thank you

(Below is the code that I'm using for conversion into tflite)

import tensorflow as tf

localpb = 'frozen_inference_graph.pb'
tflite_file = 'frozen_inference_graph.lite'

print("{} -> {}".format(localpb, tflite_file))

converter = tf.lite.TFLiteConverter.from_frozen_graph(localpb, ['image_tensor'], ['raw_detection_scores'], {'image_tensor' : [1, image_size, image_size, 3]} )

tflite_model = converter.convert()
0 Answers
Related