DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to export a YOLO model to ONNX for deployment with Ultralytics

Turn a trained YOLO model into an ONNX file you can run outside PyTorch.

Short answer: Install with pip install ultralytics; then load your trained model with YOLO; call model.export(format="onnx"), which returns the path to the exported model. All steps.

  • Data and analytics
  • Intermediate
  • 20 minutes
  • From the README
  • Claude Code
  • Codex
  • Cursor
  • Gemini CLI

platform. AGPL-3.0 applies to deployments too; check the license before shipping a closed product.

Who it is forAn engineer deploying detection to a server or edge device.

The problemPyTorch checkpoints are awkward to ship to production runtimes.

The outcomeAn ONNX model file and its path.

What you need first

  • Python 3.8 or newer with pip (PyTorch is installed with the package requirements)
  • A GPU is optional for prediction and recommended for training
  • Images or video to run on, or a dataset config for training

Steps

  1. Install with pip install ultralytics
  2. Load your trained model with YOLO
  3. Call model.export(format="onnx"), which returns the path to the exported model
  4. Load the ONNX file in your deployment runtime

Prompt for your agent

Using ultralytics/ultralytics, load <my trained weights>, export them with model.export(format="onnx"), and show me how to run the ONNX file on one image.

Caveat. This card is written from the ultralytics/ultralytics README, not from a test run by Deduped. Before you start, make sure you have Python 3.8 or newer with pip. Check the repo for newer instructions before you rely on these steps.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for ultralytics/ultralytics and "Export a YOLO model to ONNX for deployment"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer