Follow the tutorial "export Pytorch model with custom op to ONNX and run it in ONNX Runtime" here, and combine with corresponding cpp file here -> infer.py I've exported it to onnx sucessfully by registering custom NMS op in pytorch. However it was exported as multi_label_nms, not the desired 'NonMaxSupression' block defined in onnx operators.
While quoted from the tutorial mentioned above,
"You can export your custom operator using existing ONNX ops, or you can create custom ONNX ops to use. In both cases, you need to add the symbolic method to the exporter, and register your custom symbolic using torch.onnx.register_custom_op_symbolic" and "If you are using existing ONNX ops only, you do not need to go through this last step (register in onnxrutime)."
These words made me confused. I did exported to an existing ONNX op!
BTW, i made a model with onnx helper functions and then sucessfully run on onnxrutime. But append a NMS node to the existing graph didn't pass onnxruntime - report sth like no register NMS module.
I'm really confused how onnx match onnxruntime.
Anyone can give an example of exporting pytorch to an existing onnx operator ?
There was a typo in my code, i.e. i didn't type the right name of existing onnx NMS name. check it out from github onnx ; After chaning to the right name, i sucessfully ran it on onnxruntime.
Follow the tutorial "export Pytorch model with custom op to ONNX and run it in ONNX Runtime" here, and combine with corresponding cpp file here -> infer.py I've exported it to onnx sucessfully by registering custom NMS op in pytorch. However it was exported as multi_label_nms, not the desired 'NonMaxSupression' block defined in onnx operators.
While quoted from the tutorial mentioned above, "You can export your custom operator using existing ONNX ops, or you can create custom ONNX ops to use. In both cases, you need to add the symbolic method to the exporter, and register your custom symbolic using torch.onnx.register_custom_op_symbolic" and "If you are using existing ONNX ops only, you do not need to go through this last step (register in onnxrutime)."
These words made me confused. I did exported to an existing ONNX op!
BTW, i made a model with onnx helper functions and then sucessfully run on onnxrutime. But append a NMS node to the existing graph didn't pass onnxruntime - report sth like no register NMS module.
I'm really confused how onnx match onnxruntime.
Anyone can give an example of exporting pytorch to an existing onnx operator ?