onnx-tensorflow icon indicating copy to clipboard operation
onnx-tensorflow copied to clipboard

Issues when I convert my model .onnx to .tflite

Open elYeodeol opened this issue 2 years ago • 1 comments

Hey everybody,

I would like to convert my model .onnx to tflite. I read that in order to do this I need to convert my model first in .pb format and then in .tflite format. I would like to keep the same input/output names and the same input/output shape and in the right order! But when I convert my model to .pb and check after my i/o (and signatures), i don't get the right name, the right shape and the right order.

Can someone please explain why and how can I fix this ?

Thanks !

elYeodeol avatar Apr 04 '22 16:04 elYeodeol

You should be able to see the inputs and outputs, name, shape, and data type with the following

m = tf.saved_model.load(model_path)
print('model serving inputs=>', m.signatures['serving_default'].structured_input_signature)
print('model serving outputs=>', m.signatures['serving_default'].structured_outputs)

chinhuang007 avatar May 05 '22 18:05 chinhuang007