Mathevilg opened a new issue, #17767:
URL: https://github.com/apache/tvm/issues/17767
When converting ONNX models that contain dynamic control flow (e.g., the
Loop operator) or post-processing operations such as NonMaxSuppression using
TVM's Relax ONNX frontend, the conversion fails with the following error:
tvm.error.OpNotImplemented: The following operators are not supported for
frontend ONNX: Loop, NonMaxSuppression
This issue prevents conversion of models such as YOLOv3/YOLOv5 that include
these operators. It appears that the Relax ONNX frontend does not currently
implement these operators.
Steps to Reproduce:
Export a YOLO model (or any model containing Loop and/or
NonMaxSuppression) to ONNX.
Load the ONNX model using TVM's Relax ONNX frontend:
````
import onnx
import tvm.relax as relax
onnx_model = onnx.load("path/to/model.onnx")
shape_dict = {"input": (1, 3, 640, 640)}
mod, params = relax.frontend.from_onnx(onnx_model, shape_dict)
````
Expected Behavior: Either these operators should be supported by the ONNX
Relax frontend, or the frontend should provide a clear message or workaround
(such as lowering them to supported operators) so that users can convert their
models.
Environment:
TVM Version: 19
Model: YOLO model onnx -
https://github.com/onnx/models/tree/main/validated/vision/object_detection_segmentation/yolov3
Additional Info: The issue appears when converting models that rely on
dynamic control flow or include post-processing operators like Loop and
NonMaxSuppression.
Additional Context: This issue was encountered while attempting to convert a
YOLO model to TVM Relax IR. Any guidance or **workarounds** on handling these
operators would be greatly appreciated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]