onnx-tensorflow
onnx-tensorflow copied to clipboard
Issues when I convert my model .onnx to .tflite
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 !
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)