ultralytics / ultralytics

Ultralytics YOLO11 🚀
https://docs.ultralytics.com
GNU Affero General Public License v3.0
32.37k stars 6.22k forks source link

Yolov9 onnx export #14416

Open duymanh-111 opened 4 months ago

duymanh-111 commented 4 months ago

Search before asking

Description

Dear glenn-jocher! Thanks for your great job. I have met a problem on yolov9 inference development. How to export yolov9 model to onnx? I tried, but failed. I would appreciate you to help me. Thanks.

Use case

No response

Additional

No response

Are you willing to submit a PR?

pderrenger commented 4 months ago

@duymanh-111 hello,

Thank you for your kind words and for using YOLOv9! To export a YOLOv9 model to ONNX, you can follow these steps:

  1. Ensure you have the latest version of the Ultralytics package installed:

    pip install --upgrade ultralytics
  2. Use the following code to export your YOLOv9 model to ONNX format:

    from ultralytics import YOLO
    
    # Load the YOLOv9 model
    model = YOLO("yolov9c.pt")
    
    # Export the model to ONNX format
    model.export(format="onnx")  # This will create 'yolov9.onnx'
  3. Alternatively, you can use the CLI:

    yolo export model=yolov9c.pt format=onnx

If you encounter any issues, please ensure you are using the latest package versions and provide any error messages for further assistance.

duymanh-111 commented 3 months ago

Thanks Beautiful Paula! I'll check it and inform you. Thanks again.

pderrenger commented 3 months ago

@duymanh-111 you're welcome! Feel free to reach out if you have any more questions or run into any issues. Happy coding!

github-actions[bot] commented 2 months ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

glenn-jocher commented 2 months ago

@duymanh-111 thank you for your kind words. To export the YOLOv9 model to ONNX, you can use the following command:

yolo export model=yolov9.pt format=onnx

If you encounter any issues, please ensure you are using the latest version of the Ultralytics package. For further details, you can refer to the export documentation.

github-actions[bot] commented 1 day ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐