> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ovalbee.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ovalbee.com/_mcp/server.

# Export YOLO

> Convert a YOLO checkpoint to PyTorch, ONNX and TensorRT and attach every format to the model it came from.

Runs on: gpu  Dockerfile

> **Note**
>
> First run can take longer while the worker pulls the configured Docker image.

## Overview

Converts a YOLO detection checkpoint to PyTorch, ONNX, or TensorRT, whichever formats you tick, and attaches each result to the model version the weights came from.

The model then carries its weights and every format it has been exported to, and the model page lists them for download. A format already exported from the same checkpoint is reused instead of converted again.

Use it after [Train YOLO](/node-library/nodes/models-yolo-train-yolo) when a checkpoint needs a deployment format.

```mermaid
flowchart LR
  n1["Train YOLO"] --> n2["Export YOLO"] --> n3["Exported model files"]
```

## Prerequisites

| Requirement    | What you need                                                                                                                                                                                                      |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **YOLO model** | A YOLO detection model version with its own `.pt` or `.pth` checkpoint, e.g. one trained by Train YOLO. A model copied from the catalog has no file to convert, because Ultralytics downloads its weights by name. |
| **NVIDIA GPU** | A GPU worker with a working NVIDIA runtime. The node requests one for every run, and TensorRT has no CPU fallback.                                                                                                 |

## How it works

Checks each ticked format against the exports already on the model version and skips the ones built from the same checkpoint before.

Downloads the version's checkpoint once, for however many formats are left to build.

Hands it to Ultralytics per format. The PyTorch target stages the checkpoint itself, and a format that comes back as a folder is zipped first.

Attaches every produced file to the source model version and returns the same model reference it was given.

## FAQ

#### When does the node reuse an export?

When the model version already carries an export of that format built from the same checkpoint. Every ticked format is checked separately, so a run can build one format and reuse another. Rerunning with the same settings therefore builds nothing new.

#### Does exporting create a new model version?

No. An export is another file on the version it came from, and the **Model** output is the same reference as the input, so downstream nodes keep running the original weights.

#### Why tick several formats in one run instead of one node each?

One run downloads the checkpoint once and attaches every format to the same version. A TensorRT engine is built from an intermediate ONNX graph, so ticking ONNX as well costs one trace rather than two.

#### Which checkpoint does the node export?

The checkpoint the picked version points at, which for a training run is its best checkpoint. The file must end in `.pt` or `.pth`, otherwise the run stops.

#### Why does TensorRT need a GPU?

TensorRT builds its engine on a CUDA GPU and has no CPU fallback. The node runs on GPU machine classes only and checks the GPU works before it downloads or converts anything, so a run on a broken GPU stops before any format is built. Every format in the run, ONNX included, is exported on that GPU.

#### What does this node not support?

Instance segmentation models aren't offered in the **Model** picker. Every export is full precision (FP32), and the remaining Ultralytics export settings stay at their defaults. At least one format must be ticked, or the run stops.

#### Why wasn't the checkpoint found?

The version may have no weights of its own, as with a model copied from the catalog, or its model files may hold no `.pt` or `.pth` checkpoint. Train from the catalog model first, then export the version that run produced.

## Inputs

**`Model`** `model` — required

Detection model whose checkpoint is exported, e.g. a version trained in this workspace. A model copied from the catalog hosts no weights of its own and has nothing to export, so train from it first. Key: `MODEL`.

---

**`Export to PyTorch`** `boolean` — required, default: false

Attach the checkpoint itself as a PyTorch export. Key: `EXPORT_PYTORCH`.

---

**`Export to ONNX`** `boolean` — required, default: false

Trace the checkpoint to an ONNX graph. Key: `EXPORT_ONNX`.

---

**`Export to TensorRT`** `boolean` — required, default: false

Build a TensorRT engine. It is cut from an intermediate ONNX graph, so ticking ONNX as well costs one trace rather than two. Key: `EXPORT_TENSORRT`.

---

## Outputs

**`Exported formats`** `string`

Format keys this run produced, comma separated. Read by the download widget. Hidden from the flow editor. Key: `EXPORT_FORMATS`.

---

**`Model`** `model`

The model that was exported, as `&lt;model id&gt;@&lt;version id&gt;` - the same reference this node was given. An export is another file on that version, not a version of its own, so this output wires on to anything the input accepts. Shown as an artifact. Key: `MODEL`.

---

## Widgets

The model download widget downloads what this run produced: a single file when the run produced exactly one, and a zip of every ticked format, class lists included, when it produced more. The model version page lists the same files one by one.

## Runtime

The export runs in a Docker image based on Ultralytics `8.4.33` on a GPU worker, with TensorRT 10 and the GPU build of ONNX Runtime installed. TensorRT requires a CUDA GPU visible inside the container.

## JSON config

Machine-readable node interface for automation and advanced usage.

#### Show JSON

```json
{
  "name": "Export YOLO",
  "description": "Convert a YOLO checkpoint to PyTorch, ONNX and TensorRT and attach every format to the model it came from.",
  "category": "Models",
  "namespace": "ovalbee",
  "templateKey": "models/yolo/export_yolo",
  "version": "v1",
  "inputs": [
    {
      "key": "MODEL",
      "label": "Model",
      "type": "model",
      "description": "Detection model whose checkpoint is exported, e.g. a version trained in this workspace. A model copied from the catalog hosts no weights of its own and has nothing to export, so train from it first.\n",
      "required": true,
      "default": null,
      "visibleWhen": null,
      "options": {
        "framework": "yolo",
        "task_type": "object_detection"
      }
    },
    {
      "key": "EXPORT_PYTORCH",
      "label": "Export to PyTorch",
      "type": "boolean",
      "description": "Attach the checkpoint itself as a PyTorch export.",
      "required": true,
      "default": false,
      "visibleWhen": null
    },
    {
      "key": "EXPORT_ONNX",
      "label": "Export to ONNX",
      "type": "boolean",
      "description": "Trace the checkpoint to an ONNX graph.",
      "required": true,
      "default": false,
      "visibleWhen": null
    },
    {
      "key": "EXPORT_TENSORRT",
      "label": "Export to TensorRT",
      "type": "boolean",
      "description": "Build a TensorRT engine. It is cut from an intermediate ONNX graph, so ticking ONNX as well costs one trace rather than two.",
      "required": true,
      "default": false,
      "visibleWhen": null
    }
  ],
  "outputs": [
    {
      "key": "EXPORT_FORMATS",
      "label": "Exported formats",
      "type": "string",
      "description": "Format keys this run produced, comma separated. Read by the download widget.",
      "artifact": false,
      "badge": false,
      "badgeOpens": null,
      "hidden": true
    },
    {
      "key": "MODEL",
      "label": "Model",
      "type": "model",
      "description": "The model that was exported, as `<model id>@<version id>` - the same reference this node was given. An export is another file on that version, not a version of its own, so this output wires on to anything the input accepts.\n",
      "artifact": true,
      "badge": false,
      "badgeOpens": null,
      "hidden": false
    }
  ],
  "runtime": {
    "type": "docker",
    "devices": [
      "gpu"
    ],
    "dockerImage": "ovalbee/node-yolo-export:0.0.15"
  },
  "widgets": {
    "widget": {
      "id": "model-download",
      "settings": {
        "assetId": {
          "type": "variable",
          "value": "self.outputs.MODEL"
        },
        "format": {
          "type": "variable",
          "value": "self.outputs.EXPORT_FORMATS"
        }
      }
    }
  }
}
```

## References

#### Sources and related pages

* [Train YOLO](/node-library/nodes/models-yolo-train-yolo)
* [Ultralytics repository at v8.4.33](https://github.com/ultralytics/ultralytics/tree/v8.4.33)
* [Export mode documentation at v8.4.33](https://github.com/ultralytics/ultralytics/blob/v8.4.33/docs/en/modes/export.md)