Open mhs4670go opened 3 years ago
The problem stems from the dynamic shape API in TFLite.
TF 2.X automatically generates those weird operators (Squeeze, Reshape, Shape) to support dynamic shape in TFLite. This is somewhat strange because we've given the static input shape to one-import-tf
(-S 1,299,299,3
in the above example).
I've found out that currently tf2tfliteV2.py
ignores input_shape
option if it is called with --v2
. I guess this is because there is no option to specify input shape in TF 2.0. Preferred workaround is to directly set shape in the graph.
https://github.com/tensorflow/tensorflow/issues/30180#issuecomment-505959220
I've checked that the shape-changing operators (squeeze, reshape, shape) are not generated if the workaround is used. So, how about adding the workaround to tf2tfliteV2.py
? Maybe I can make a change for that.
@mhs4670go #5394 may have solved the problem of this issue. Do you still want to implement SHAPE Op in luci-interpreter?
5394 may have solved the problem of this issue.
For TF models, it will work. What about tflite
files that wasn't converted by our tool?
What about tflite files that wasn't converted by our tool?
The official inception v3 tflite model does not have SHAPE Op, so it may not fail.
For other models with SHAPE Op, circle-quantizer may fail. I'll support it. Thanks.
What
We need to support
Shape
op inluci-interpreter
.Why
When we test release binary, one of those model we run is
inception_v3
. You can get it with below command.There is no problem with tensorflow 1.x version but with tensorflow 2.x it's got different result.
Since the network has
Shape
operator, it throws NYI error when I runrecord-minmax
with it.I'd appreciate if you could support this feature.