Train YOLO

GPU Dockerfile
First run can take longer while the worker pulls the configured Docker image.

Overview

Fine-tunes a YOLO model from your workspace registry on an OvalBee train and validation dataset, and registers the result as a new version of that model. The node converts both datasets to YOLO format itself, so no conversion or upload node sits on either side of it.

What the model learns comes from the task type of the model you pick, not from a setting on this node:

  • Object detection models train on bounding boxes.
  • Instance segmentation models train on masks, exported as YOLO polygon labels.

Classification and pose models aren’t supported. The run’s live report opens from the node, and the Best Loss badge shows the lowest training loss reached.

Dataset Train/validation split Train YOLO Model version

Pretrained models

The model catalog ships these COCO-pretrained detectors. Copy one into your workspace from the Model picker to use it. OvalBee hosts none of these weights: Ultralytics downloads the checkpoint by name on first use.

ModelCheckpointInput sizeCOCO val mAP50-95Parameters, MFLOPs, B
YOLOv8nyolov8n.pt64037.33.28.7
YOLOv8syolov8s.pt64044.911.228.6
YOLOv8myolov8m.pt64050.225.978.9
YOLOv8lyolov8l.pt64052.943.7165.2
YOLOv8xyolov8x.pt64053.968.2257.8
YOLOv9cyolov9c.pt64053.025.5102.8
YOLOv9eyolov9e.pt64055.658.1192.5
YOLO11nyolo11n.pt64039.52.66.5
YOLO11syolo11s.pt64047.09.421.5
YOLO11myolo11m.pt64051.520.168.0
YOLO11lyolo11l.pt64053.425.386.9
YOLO11xyolo11x.pt64054.756.9194.9

These numbers come from the Ultralytics 8.4.33 COCO benchmarks, the same mAP and parameter figures the catalog shows for each model. They do not guarantee the same performance on an OvalBee worker. Speed is omitted because YOLOv8 uses A100 results, YOLO11 uses T4 results, and YOLOv9 does not publish speed results. The catalog has no segmentation checkpoints. For instance segmentation, the workspace needs a YOLO model registered as instance segmentation, such as a -seg checkpoint added with Upload model.

Prerequisites

RequirementWhat you need
GPU workerA worker with GPU execution enabled.
Annotated datasetsA train and a validation dataset with object annotations, holding different images, e.g. the outputs of Train/validation split. Instance segmentation needs polygon or mask annotations.
YOLO modelA YOLO model in the workspace registry: a catalog model copied in from the picker, a version from an earlier training run, or a checkpoint registered with Upload model.

The node writes this tree into the task’s own working directory before training:

📁 dataset/
├── 📄 data.yaml
├── 📁 images/
│ ├── 📁 train/
│ └── 📁 val/
└── 📁 labels/
├── 📁 train/
└── 📁 val/

Instance segmentation runs write the same tree, with polygon label lines instead of boxes. Both datasets are exported in a single pass so the two splits share one class index space. The tree is rebuilt from the datasets on every run and nothing downstream can read it.

How it works

1

Exports the train and validation datasets to a YOLO-format tree, as boxes or polygons depending on the model’s task type.

2

Loads the starting weights of the picked version and checks that they match its task type.

3

Trains with Ultralytics. The new version is created as training starts and receives checkpoints while the run goes, and the live report updates beside it.

4

Predicts on up to eight validation images with the best checkpoint and adds them to the report.

5

Uploads the final checkpoints and metrics, marks the version ready, and returns it on Model.

FAQ

Every run adds a new version to the model, or to Destination model when one is set. Earlier versions stay in the registry and the source datasets aren’t changed. When Model names the model itself rather than a pinned version, it follows the newest ready version, so a rerun that trains into the same model fine-tunes the previous run’s result. Pick a specific version to start every run from the same weights.

The version is created before training starts and receives the latest best and last checkpoints about every two minutes. A run that fails keeps what it uploaded, and its version is marked failed, so it isn’t offered in the model pickers. If uploading fails five times in a row, the node stops training rather than carry on with no way to save the result.

The version holds best.pt and last.pt (intermediate epoch checkpoints are not kept), the Ultralytics results and plots, your hyperparameters as typed, and the full argument set Ultralytics resolved. It also records the class list, the train and validation datasets, the version training started from, the training report, and the last epoch’s mAP50, mAP50-95, precision, and recall. Segmentation runs add mask mAP50 and mask mAP50-95.

When the train dataset is pinned to an ontology, the model learns that ontology’s object classes in its order, and labels of any other class are skipped. Otherwise the classes come from the annotations in the datasets. Tags never become classes.

Detection trains on boxes: polygons, masks, and other shapes are converted to their bounding boxes. Instance segmentation trains on polygons, with masks converted to polygons. Rectangles are skipped, and a run whose datasets hold only rectangles stops with an error.

For each epoch, the node adds up the box, classification, and distribution focal training losses, plus the segmentation loss on segmentation runs. The badge shows the lowest sum as Loss: value with four decimal places. It stays empty if Ultralytics logged no readable loss rows.

The datasets hold no annotated object classes, so there is nothing to train on. The check uses the datasets’ computed statistics before anything is downloaded, and the export repeats it. For instance segmentation the datasets must also hold polygon or mask annotations. Check the dataset contents, then rerun.

Hyperparameters may not be a YAML mapping, or it may contain an invalid Ultralytics argument. Fix the YAML and check its arguments against the pinned Ultralytics configuration reference.

The model’s task type must be object detection or instance segmentation. The version must also have weights to start from: a checkpoint in its asset, or a checkpoint name Ultralytics can download. A catalog checkpoint that contradicts the task type, such as a -seg checkpoint on a detection model, is rejected.

Training continues when the report asset cannot be created. Check the run logs and workspace asset permissions.

Inputs

Train dataset
datasetRequired

Dataset to train on. Its assets and annotations are converted to YOLO format for you, so nothing has to convert them first. Key: TRAIN_DATASET.

Validation dataset
datasetRequired

Dataset held out to measure quality while training runs. Converted together with the training dataset, so both share the same class list. Key: VAL_DATASET.

Model
modelRequired

Model to fine-tune, trained in this workspace or installed from the zoo. Training starts from the weights of the version you pick, and the result is registered as a new version of this model unless Destination model names another one. Key: MODEL.

Destination model
model

Model the trained version is registered under, when it should not go to the one being fine-tuned. Leave empty to add the new version to the Model above. Key: DESTINATION_MODEL.

Hyperparameters
yamlRequired

Ultralytics training settings in YAML - number of epochs, image size, batch size and the rest. Dataset paths and the output location are filled in for you and cannot be set here. Key: CONFIG.

Outputs

Report Asset
report

ID of the asset containing the live YOLO training report. Shown as an artifact. Key: REPORT_ID.

Model
model

Reference to the registry version this run produced, as <model id>@<version id>. It wires into the Model input of a predict, export or evaluate node and pins it to exactly these weights. Empty when the run could not be registered. Shown as an artifact. Key: MODEL.

Best Loss
string

Lowest total training loss achieved (shown as a badge). Shown on the node as a badge. Key: BEST_LOSS.

Models and configuration

Model is both what training starts from and where its result is filed: the run adds a version to that model. Set Destination model to file the result elsewhere. The trained version is created there instead, and Model is then only the starting weights. Both pickers list only YOLO models of this workspace, and only their ready versions.

A version produced by training or registered by upload starts from the checkpoint stored with it, the best one when there are several. A version copied from the catalog hosts no weights of its own, so Ultralytics downloads its checkpoint by name. Either way the new version records the picked version as its starting point.

OvalBee starts with these values in Hyperparameters:

SettingDefaultMeaning
epochs100Maximum training epochs
imgsz640Training and validation image size
batch16Batch size passed to Ultralytics
patience20Early-stopping patience
workers8Data-loading workers
plotstrueGenerate Ultralytics diagnostic plots
savetrueSave checkpoints
valtrueRun validation during training

Delete a value to use the pinned Ultralytics default instead.

Hyperparameters must be a YAML mapping. The effective configuration follows this order:

  1. Values present in Hyperparameters override Ultralytics 8.4.33 defaults.
  2. The selected Model overrides and removes model.
  3. The node overrides data, project, name, and exist_ok so the exported dataset and the task’s artifacts directory are used.
  4. Other valid Ultralytics training arguments pass through unchanged.

Report

The report appears near the start of training and updates as new metrics and files arrive. It tracks metrics, losses, learning rates, plots, TensorBoard, and checkpoints. A final update after training adds the predictions gallery and a download panel for the trained checkpoints.

SectionWhat it showsWhen it appears
OverviewmAP50-95, mAP50, precision, and recall, a one-line verdict, and the run’s model, epochs, duration, image counts, and classes. A warning appears when training and validation hold the same images.From the first report sync. Metrics read N/A until a validation row exists.
PredictionsPredictions from the best checkpoint on a fixed sample of up to eight validation images.After training. Skipped when validation images, classes, or a saved checkpoint are unavailable.
Evaluation metricsThe same four box metrics, from the epoch with the best validation mAP50-95.From the first report sync.
Training curvesEvery loss, metric, and learning-rate series Ultralytics logs per epoch.From the first report sync. The charts fill as epochs complete.
Diagnostic plotsResults, confusion matrices, and precision-recall, precision, recall, and F1 curves rendered by Ultralytics.After at least one plot exists.
TensorBoardThe TensorBoard event stream.From the first report sync. Empty until Ultralytics writes events.
ArtifactsSaved .pt checkpoints and their sizes, replaced by a checkpoint download panel after training.The list updates during training.
ClassesEach class with its model output index.Once class names are known.
HyperparametersThe Hyperparameters YAML as the node read it.When Hyperparameters is not empty.
How to use the trained modelA minimal local Ultralytics example that loads best.pt and predicts an image.From the first report sync.

Runtime

GPU memory use depends on the model, image size, and batch size. OvalBee does not list specific RTX models as supported because the runtime image has no pinned digest or recorded end-to-end hardware matrix.

  • Configured image: cr.internal.supervisely.com/ovalbee-internal/nodes/yolo:0.0.12.
  • Upstream base: ultralytics/ultralytics:8.4.33.
  • Added components: OvalBee SDK, TensorBoard, and the Ultralytics TensorBoard integration.
  • Exact CUDA, PyTorch, NVIDIA driver, and GPU compatibility depends on the image digest deployed by the worker.

JSON config

Machine-readable node interface for automation and advanced usage.

{
"name": "Train YOLO",
"description": "Train a YOLO object detection or instance segmentation model directly on OvalBee datasets.",
"category": "Train",
"namespace": "ovalbee",
"templateKey": "models/yolo/train_yolo",
"version": "v1",
"inputs": [
{
"key": "TRAIN_DATASET",
"label": "Train dataset",
"type": "dataset",
"description": "Dataset to train on. Its assets and annotations are converted to YOLO format for you, so nothing has to convert them first.",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"creatable": false
}
},
{
"key": "VAL_DATASET",
"label": "Validation dataset",
"type": "dataset",
"description": "Dataset held out to measure quality while training runs. Converted together with the training dataset, so both share the same class list.",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"creatable": false
}
},
{
"key": "MODEL",
"label": "Model",
"type": "model",
"description": "Model to fine-tune, trained in this workspace or installed from the zoo. Training starts from the weights of the version you pick, and the result is registered as a new version of this model unless Destination model names another one.\n",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"scope": "my",
"framework": "yolo"
}
},
{
"key": "DESTINATION_MODEL",
"label": "Destination model",
"type": "model",
"description": "Model the trained version is registered under, when it should not go to the one being fine-tuned. Leave empty to add the new version to the Model above.\n",
"required": false,
"default": null,
"visibleWhen": null,
"options": {
"scope": "my",
"framework": "yolo"
}
},
{
"key": "CONFIG",
"label": "Hyperparameters",
"type": "yaml",
"description": "Ultralytics training settings in YAML - number of epochs, image size, batch size and the rest. Dataset paths and the output location are filled in for you and cannot be set here.",
"required": true,
"default": "epochs: 100\nimgsz: 640\nbatch: 16\npatience: 20\nworkers: 8\nplots: true\nsave: true\nval: true\n",
"visibleWhen": null
}
],
"outputs": [
{
"key": "REPORT_ID",
"label": "Report Asset",
"type": "report",
"description": "ID of the asset containing the live YOLO training report.",
"artifact": true,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "MODEL",
"label": "Model",
"type": "model",
"description": "Reference to the registry version this run produced, as `<model id>@<version id>`. It wires into the Model input of a predict, export or evaluate node and pins it to exactly these weights. Empty when the run could not be registered.\n",
"artifact": true,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "BEST_LOSS",
"label": "Best Loss",
"type": "string",
"description": "Lowest total training loss achieved (shown as a badge).",
"artifact": false,
"badge": true,
"badgeOpens": null,
"hidden": false
}
],
"runtime": {
"type": "docker",
"requiresGpu": true,
"dockerImage": "cr.internal.supervisely.com/ovalbee-internal/nodes/yolo:0.0.12"
},
"widgets": {
"widget": {
"id": "report-preview",
"settings": {
"reportAsset": {
"type": "variable",
"value": "self.outputs.REPORT_ID"
},
"name": {
"type": "input",
"value": "Open training report"
}
}
}
}
}

References