Dynamic input support for TFLite models

611 views
Skip to first unread message

Neha Soni

unread,
May 2, 2021, 6:24:42 AM5/2/21
to TensorFlow Lite
Hi all
Hope you are doing well.
I have a TF model with (None,None,100) input dims and its converted into TFLite too.
But when I do inference, it gives error-
RuntimeError: tensorflow/lite/kernels/reshape.cc:58 stretch_dim != -1 (0 != -1)Node number 72 (RESHAPE) failed to prepare.

TF version is 2.4.1.
I have seen some work @sayal Paul on this too. LINK
      interpreter.resize_tensor_input(0, [1, image.shape[1], image.shape[2], 3])
Please help me in this regard.
Looking forward to hearing from you.

Jaesung Chung

unread,
May 3, 2021, 7:37:55 PM5/3/21
to Neha Soni, TensorFlow Lite
Hi Neha,

Could you file an issue at the TensorFlow github for this issue with a minimal reproducible step?

Does the interpreter.resize_tensor_input method work for your case?
I would also recommend trying out the tf-nightly version from the conversion stage to the inference stage.

Best regards,
Jaesung

--
You received this message because you are subscribed to the Google Groups "TensorFlow Lite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tflite+un...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/tflite/6ee97cc3-5c25-4e0e-b72f-3c33ad8b55a9n%40tensorflow.org.
Reply all
Reply to author
Forward
0 new messages