THU-MIG / yolov10

YOLOv10: Real-Time End-to-End Object Detection
https://arxiv.org/abs/2405.14458
GNU Affero General Public License v3.0
8.55k stars 747 forks source link

Exporting tensorRT models is not supported #129

Closed Haroldhy closed 1 month ago

Haroldhy commented 1 month ago

I use “yolo export model=yolov10n/s/m/b/l/x.pt format=onnx opset=13 simplify” to export onnx model. The exported model contains the fmod(Mod) operator, which is an operator supported by onnx but not by tensorRT, so when exporting the onnx model to a tensorRT model it will report an error. My target version of TensorRT is 8.4.1.

jameslahm commented 1 month ago

Thanks for your interest! Does this issue #75 help?

Haroldhy commented 1 month ago

Thanks for your answer. The issue indicates that if I don't use the new version of tensorRT, I will need to remove the mod operator from the onnx model, then I will get a model with three outputs. 1x300x4, 1x300x1 and the output of the 1x300 shape that needs to be processed. Then just need to do a mod on the last output right?

jameslahm commented 1 month ago

Yes, we think so.

jameslahm commented 1 month ago

Please feel free to reopen this issue if you have further questions.

jasonlytehouse commented 1 month ago

If you're curious about the code to do this, I have a script called v10_fixer.py here that does this