glow icon indicating copy to clipboard operation
glow copied to clipboard

Loop operator is not supported

Open tijithomas opened this issue 5 years ago • 8 comments

While compiling ssd_mobilenet_v1_coco_2018_01_28 onnx model, got the following error: "Failed to load operator Loop"

Screenshot from 2019-12-26 14-00-37

tijithomas avatar Dec 26 '19 08:12 tijithomas

Hi @tijithomas, we currently do not support control flow. We would need to unroll the loop for this to work. This means we would need the trip count input to be a constant known at compile time. I'm not familiar with the details of this op so not sure if this is possible.

jfix71 avatar Dec 26 '19 09:12 jfix71

You can freeze the graph so that loop operator is not present. At least for ssd mobilenet v2. @ksaurabh-cadence

ayermolo avatar Jan 02 '20 22:01 ayermolo

Hi @ayermolo , I tried to use the frozen inference graph from ssd mobilent v2 tensorflow model to convert it into onnx. The generated onnx model still has loop operator. How do you freeze the onnx graph? Can you share your frozen onnx model?

tijithomas avatar Jan 03 '20 04:01 tijithomas

@ayermolo , Also please share the versions of onnx, opset, and tf2onnx (if you used it to convert to onnx).

tijithomas avatar Jan 03 '20 06:01 tijithomas

@jfix71 Are node attributes of type Graph supported in Glow yet?

tijithomas avatar Jan 03 '20 09:01 tijithomas

@tijithomas Did you freeze the model as it is? In our experience updating the pipeline config in the original model to have "use_static_shapes: true" is better since glow doesn't support dynamic shapes. Did you try that? However this might lead to another problem as TF's NMSv4 is not supported in ONNX yet, but can be supported via a custom operator.

ksaurabh-cadence avatar Jan 03 '20 17:01 ksaurabh-cadence

@ksaurabh-cadence Thanks for jumping in. :D

ayermolo avatar Jan 03 '20 19:01 ayermolo

Was this ever resolved? The loop in fact is static according to the OONX graph expansion shown (start at 0, 37 iterations, so 0 to 36); it also says the output for iteration 36 is unused, which seems strange. Since all of the normal MobileNet-SSD implementations use this LOOP, doesn't that suggest that handling it by unrolling or otherwise is pretty important?

pkimelman-nxp avatar Jan 26 '21 15:01 pkimelman-nxp