-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix TFLite RESHAPE assert #4320
Conversation
@FrozenGene Can you have a look? |
could we add one unittest? |
In addition I would request a comment in the code about the status in 1.13 and if possible the version of tflite when this changed. |
@FrozenGene I tried to prepare tflite file with RESHAPE op having only one input tensor. But it always give me model with two input tensors for RESHAPE op. Do you know how to force tflite converter to create RESHAPE op with only one tensor? my models https://www.dropbox.com/s/bhvuhrio277ka82/Screenshot%202019-11-13%2016.40.55.png?dl=0 hand_landmark.tflite model (has only one tensor in RESHAPE input) One of the solutions is to add |
I can not construct it too. A bit strange. We could add hand_landmark.tflite, however, we should also have unittest of reshape in my opinion. |
TVM code does not use the second input tensor in RESHAPE op. From the beginning the assert should just check that input tensors array length is at least 1. |
I've been noticing differences in the tflite converter graph between 1.13 and 1.14 especially with split and unpack - have either of you guys played with multiple versions of the tfliteconverter ? |
4dc155e
to
ac9c3f8
Compare
ac9c3f8
to
9090955
Compare
@FrozenGene All checks have passed - Can you approve? |
Thanks @apivovarov @FrozenGene @u99127 |
Recently I found that Reshape op input might have 1 or 2 input tensors.
in TVM code we assert that length is 2 but we only use
input_tensor[0]
.Looks like the second input tensor was reshape shape in the past. But current TFLite schema which we use r1.13 has
ReshapeOptions
which containsnew_shape
:We do not use the second input tensor in TFLite frontend, we use
ReshapeOptions
instead.What is more is that I have custom tflite model which has only one input tensor for RESHAPE op.
Current assert for input tensors length makes the compilation fail.
I suggest what we allow input tensors length for RESHAPE operator to be 1 or 2.
We can not change it to just 1 because test ops/models in
test_forward.py
have 2 input tensors for RESHAPE