Skip to navigation

Train LibreYOLO

Runs on: gpu Dockerfile
First run can take longer while the worker pulls the configured Docker image.

Overview

Fine-tunes a LibreYOLO detector from your workspace registry on OvalBee training and validation datasets, 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.

LibreYOLO is an MIT-licensed library. This node offers two detectors built on the same YOLOv9 backbone and neck, and which one trains is decided by the model you pick, not by a setting on this node:

  • YOLOv9 (LibreYOLO9) predicts boxes with the standard head, so predictions are suppressed with NMS after the network.
  • LibreYOLO9E2E adds a one-to-one head that returns final detections directly, so no NMS runs after the network. Both heads are trained together; inference uses only the one-to-one one.

Detection is the only task. The run’s live report opens from the node, and the Best mAP badge shows the best validation mAP50-95 reached.

Dataset Train/validation split Train LibreYOLO 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: the catalog names each one’s .pt file on Hugging Face, which the node downloads into its cache on first use and checks against the SHA-256 the catalog pins. With safe weights on, a .pt file is refused before it is read, so a catalog model trains once its weights are converted.

ModelHeadInput sizeCOCO val mAP50-95Parameters, M
LibreYOLO9-tNMS640not published2.0
LibreYOLO9-sNMS640not published7.2
LibreYOLO9-mNMS640not published20.1
LibreYOLO9-cNMS640not published25.5
LibreYOLO9E2E-tend-to-end64034.12.6
LibreYOLO9E2E-send-to-end64042.08.7
LibreYOLO9E2E-mend-to-end64048.024.7
LibreYOLO9E2E-cend-to-end64049.431.1

All eight are MIT-licensed. The YOLOv9 weights are those of MultimediaTechLab/YOLO (release v1.0-alpha), converted to the LibreYOLO format by the LibreYOLO project without changing the learned parameters. The E2E models keep those weights for the backbone, neck and one-to-many head and add a one-to-one head trained on COCO 2017. The mAP figures are the COCO val2017 values on the LibreYOLO9E2E model cards; the YOLOv9 cards state none. Parameter counts are those stored in each checkpoint, so an E2E model counts both heads.

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.
LibreYOLO modelA LibreYOLO model in the workspace registry: a catalog model copied in from the picker, or a version from an earlier training run.

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

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

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.

2

Loads the starting weights of the picked version: its own model files, or the file its catalog entry names. Safetensors weights are built into the network LibreYOLO defines for the version’s architecture, and the head, NMS or end-to-end, is that architecture’s; a LibreYOLO .pt is read by LibreYOLO itself, which only happens with safe weights off.

3

Trains with LibreYOLO. The new version is created as training starts and receives its best weights while the run goes, and the live report updates beside it.

4

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

5

Uploads the best weights and the metrics, marks the version ready, and returns it on Model.

FAQ

The node sets save_period to a tenth of the epoch budget, and after training it runs inference over the training split with the weights saved nearest 10%, 25% and 50% of the run and with the final weights. For every labelled object it records the confidence of the best matching prediction of the right class, or zero when nothing matches, and scores each image by the average of one minus those confidences. An object counts as found once that confidence reaches 0.25, the default confidence threshold of the matching Predict node, and an image counts as learned once at least 80% of its objects are found.

Images learned in the first quarter of the run and never lost again are the ones the model needed least. Confident predictions that match no label are counted separately: they point at missing labels or genuine mistakes, and they do not decide whether an image was learned.

Every run adds a new version to the model, or to Destination model when one is set, unless it continues a version that is not fully trained (below). 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 version that is ready or not fully trained, so a rerun that trains into the same model fine-tunes the previous run’s result, or continues that run when it did not finish. Pick a specific version to start every run from the same weights.

The version is created before training starts and receives the best weights so far about every two minutes. At the end of the first epoch, and then at an epoch’s end at most every two minutes, the node also saves a checkpoint into the version: the network, the optimizer, the position in the learning-rate schedule, the EMA weights, the mixed-precision scaler, the best mAP so far and the batch size batch: -1 settled on, with the best weights and logs as of that epoch. An epoch that is no checkpoint copies nothing for it. Training never waits for a checkpoint’s upload, and no new checkpoint starts while one uploads, so a run that is killed loses the training since its last checkpoint that finished uploading: about one epoch or two minutes, whichever is longer, plus the time a checkpoint takes to upload. A run that stops after its first checkpoint leaves the version Incomplete: the model pickers offer it with its best weights so far, marked as not fully trained, and running the node with that version in Model (Latest picks it while it is the newest) continues the run from its last checkpoint into the same version, with the settings it started with. The run’s last epoch, which is the epoch early stopping ends it at when it does, is not a checkpoint, so a run interrupted after it repeats that epoch. On Kubernetes, a run whose machine was taken away is retried and continues from its last checkpoint by itself. A run that stops before its first checkpoint marks its version failed, and 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.

Set seed in Hyperparameters to choose the run’s seed (including 0; the default is 0). The checkpoint records it. A continued run draws its shuffles and augmentations from a seed derived from the run’s seed and the epoch it continues at, so it never repeats the order and augmentations of the epochs already trained, though it does not reproduce the sequence an uninterrupted run would have drawn either.

A run that continues an unfinished version continues the same run, so the node first compares the run with the checkpoint and refuses, naming each difference, when the hyperparameters (epochs included), the classes, the datasets, the architecture or the LibreYOLO version differ. To train longer or with other settings, start from a fully trained version, or save the unfinished one as a new version and train from that.

The version holds model.safetensors, the best weights, and config.json, which names the architecture, the classes in output order and the input size, beside the LibreYOLO results and training log, your hyperparameters as typed, and the full argument set LibreYOLO resolved. It also records the class list, the train and validation datasets, the version training started from, the training report, the GPU the run used with its peak memory, and the mAP50 and mAP50-95 of the epoch that produced the best weights. No pickle (.pt) is ever written.

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. The classification layers are resized to the new class count; the rest of the network keeps its pretrained weights.

No. By default every layer trains. Add freeze: backbone to Hyperparameters to train the neck and head only; an integer or a list of layer selectors is accepted as well. LibreYOLO’s code states that in a LibreYOLO9E2E model the one-to-one head’s loss does not reach the backbone or neck, which are then trained through the one-to-many head.

LibreYOLO turns off mosaic and mixup for the last no_aug_epochs epochs, 15 by default, which suits a run of a hundred epochs or more. For a shorter run that would leave little or no strong augmentation. When Hyperparameters has no no_aug_epochs, the node sets it to a fifth of epochs, at most 15 and at least 1. Set no_aug_epochs yourself to keep your value.

It is the highest box mAP50-95 on the validation dataset over the epochs that were validated, shown as mAP: value with four decimal places. It stays empty until the first validation has run. Hyperparameters can set eval_interval to validate every N epochs; the final epoch is always validated.

In LibreYOLO’s results file the precision and recall columns repeat COCO’s mAP50-95 and AR@100 (average recall with up to 100 detections per image). The report shows mAP50-95, mAP50, mAP75 and AR@100 under their own names and publishes only mAP50 and mAP50-95 to the registry.

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. Check the dataset contents, then rerun.

Hyperparameters may not be a YAML mapping, may set a key that names a file, weights or a download, or that the node fills in itself (model, pretrained, resume, distill_model, cfg, data, project, name, exist_ok, device, …), may give a value of the wrong type, or may contain an argument the node does not accept. Every plain setting of LibreYOLO’s own training configuration for these architectures is accepted - a number, a switch or one name out of a fixed set - written as LibreYOLO itself reads it: a switch may be 1 or 0 as well as true or false, and cache: 1 caches the decoded images in RAM as cache: ram does. What is refused besides the keys above is average_best and precise_bn, which read back a checkpoint this node never writes; export_check, which belongs to Export LibreYOLO; lora, which would publish weights the other nodes cannot build; and the profile_* group, which reports the run a second way. A name LibreYOLO has no argument for is refused rather than ignored, so a typo fails at the start. The error names every problem at once.

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.

Estimate data usefulness
booleanDefaults to trueRequired

After training, score every training image with weights saved across the run to estimate how much of the data was actually needed, and publish the subset worth keeping. Sets save_period to a tenth of the epoch budget so those weights exist, and adds a few inference passes over the training split after the run. Key: ESTIMATE_DATA_USEFULNESS.

Model
modelRequired

Model to fine-tune, trained in this workspace or installed from the zoo, and with it the detection head: a YOLOv9 version trains the NMS head, a LibreYOLO9E2E one the end-to-end head that needs no NMS afterwards. 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. When the version picked is not fully trained (Latest picks one when it is the newest), the run continues that training with the settings it started with, not the ones set here. 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

LibreYOLO training settings in YAML - number of epochs, image size, batch size and the rest. Only LibreYOLO’s training arguments are accepted, each with a value of its type, anything that names a file, weights or a download (model, pretrained, resume, distill_model, cfg, …) is refused, because the starting weights always come from Model. Dataset paths, the device and the output location are filled in for you and cannot be set here. freeze: backbone trains the neck and head only, by default nothing is frozen. eval_interval is how often validation runs. Key: CONFIG.

Outputs

Report Asset
report

ID of the asset containing the live LibreYOLO 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 mAP
string

Best validation mAP (IoU 0.5:0.95) reached during the run (shown as a badge). Shown on the node as a badge. Key: BEST_MAP.

Recommended keep set
dataset

The training images this run’s usefulness estimate says are worth keeping. To check the estimate, wire it into the Train dataset of another Train LibreYOLO node that starts from the same model this run started from, and compare the two runs’ evaluation metrics. Short-lived, so copy it if you want to keep it. Empty when the estimate found nothing safe to drop. Shown as an artifact. Key: KEEP_DATASET.

Keep share
string

Share of the training images the keep set retains. Shown on the node as a badge. Selecting the badge opens KEEP_DATASET. Key: KEEP_SHARE.

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 LibreYOLO models of this workspace, with their ready versions and their incomplete ones, marked as not fully trained.

A version produced by training starts from the best weights stored with it. A version copied from the catalog hosts no weights of its own, so the node downloads the file its catalog entry names and checks its SHA-256. 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
patience20Early-stopping patience
workers8Data-loading workers
eval_interval1Validate every N epochs
save_period-1No intermediate weights; set a positive number to keep the weights of every Nth epoch (outside the published model)

Delete a value to use the LibreYOLO default instead. Its optimizer is SGD at a learning rate of 0.01 with a linear schedule, EMA and mixed precision on.

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

  1. Values present in Hyperparameters override the LibreYOLO defaults of the architecture.
  2. no_aug_epochs is derived from epochs when it is absent (see the FAQ).
  3. The node sets data, project, name, exist_ok and device so the exported dataset, the task’s artifacts directory and the GPU of the run are used, and turns on the TensorBoard logger for the report.

Report

The report appears near the start of training and updates as new metrics and files arrive. It tracks metrics, losses, learning rates, 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, mAP75 and AR@100, a one-line verdict, and the run’s model, epochs, duration, GPU, peak GPU memory, 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 weights on a fixed sample of up to eight validation images, at confidence 0.25 and NMS IoU 0.7.After training. Skipped when validation images, classes, or a saved checkpoint are unavailable.
Evaluation metricsThe same four metrics, from the epoch with the best validation mAP50-95.From the first report sync.
Training curvesThe box, classification and distribution focal losses with the total, the headline validation metrics and the learning rate, per epoch.From the first report sync. The charts fill as epochs complete.
TensorBoardThe TensorBoard event stream.From the first report sync. Empty until LibreYOLO writes events.
ArtifactsThe published model.safetensors and its size, replaced by a 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 LibreYOLO example that loads model.safetensors, names its classes from config.json and predicts an image.From the first report sync.

Runtime

GPU memory use depends on the model, image size, and batch size; the report records the peak the run reached. 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: ovalbee/node-libreyolo:0.0.17, shared with the predict and export nodes.
  • Upstream base: the OvalBee PyTorch CUDA 12.8 base image, with libreyolo==1.6.0 installed on top.
  • Added components: OvalBee SDK, TensorBoard, ONNX tooling and TensorRT for the export node.
  • 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 LibreYOLO",
"description": "Train a LibreYOLO object detector (YOLOv9 with NMS, or the NMS-free LibreYOLO9E2E) directly on OvalBee datasets.",
"category": "Train",
"namespace": "ovalbee",
"templateKey": "models/libreyolo/train_libreyolo",
"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": "ESTIMATE_DATA_USEFULNESS",
"label": "Estimate data usefulness",
"type": "boolean",
"description": "After training, score every training image with weights saved across the run to estimate how much of the data was actually needed, and publish the subset worth keeping. Sets save_period to a tenth of the epoch budget so those weights exist, and adds a few inference passes over the training split after the run.\n",
"required": true,
"default": true,
"visibleWhen": null
},
{
"key": "MODEL",
"label": "Model",
"type": "model",
"description": "Model to fine-tune, trained in this workspace or installed from the zoo, and with it the detection head: a YOLOv9 version trains the NMS head, a LibreYOLO9E2E one the end-to-end head that needs no NMS afterwards. 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. When the version picked is not fully trained (Latest picks one when it is the newest), the run continues that training with the settings it started with, not the ones set here.\n",
"required": true,
"default": null,
"visibleWhen": null,
"options": {
"scope": "my",
"framework": "libreyolo",
"include_incomplete_versions": true
}
},
{
"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": "libreyolo"
}
},
{
"key": "CONFIG",
"label": "Hyperparameters",
"type": "yaml",
"description": "LibreYOLO training settings in YAML - number of epochs, image size, batch size and the rest. Only LibreYOLO's training arguments are accepted, each with a value of its type; anything that names a file, weights or a download (`model`, `pretrained`, `resume`, `distill_model`, `cfg`, ...) is refused, because the starting weights always come from Model. Dataset paths, the device and the output location are filled in for you and cannot be set here. `freeze: backbone` trains the neck and head only; by default nothing is frozen. `eval_interval` is how often validation runs.\n",
"required": true,
"default": "epochs: 100\nimgsz: 640\nbatch: 16\npatience: 20\nworkers: 8\neval_interval: 1\nsave_period: -1\n",
"visibleWhen": null
}
],
"outputs": [
{
"key": "REPORT_ID",
"label": "Report Asset",
"type": "report",
"description": "ID of the asset containing the live LibreYOLO 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_MAP",
"label": "Best mAP",
"type": "string",
"description": "Best validation mAP (IoU 0.5:0.95) reached during the run (shown as a badge).",
"artifact": false,
"badge": true,
"badgeOpens": null,
"hidden": false
},
{
"key": "KEEP_DATASET",
"label": "Recommended keep set",
"type": "dataset",
"description": "The training images this run's usefulness estimate says are worth keeping. To check the estimate, wire it into the Train dataset of another Train LibreYOLO node that starts from the same model this run started from, and compare the two runs' evaluation metrics. Short-lived, so copy it if you want to keep it. Empty when the estimate found nothing safe to drop.\n",
"artifact": true,
"badge": false,
"badgeOpens": null,
"hidden": false
},
{
"key": "KEEP_SHARE",
"label": "Keep share",
"type": "string",
"description": "Share of the training images the keep set retains.",
"artifact": false,
"badge": true,
"badgeOpens": "KEEP_DATASET",
"hidden": false
}
],
"runtime": {
"type": "docker",
"devices": [
"gpu"
],
"dockerImage": "ovalbee/node-libreyolo:0.0.17"
},
"widgets": {
"widget": {
"id": "report-preview",
"settings": {
"reportAsset": {
"type": "variable",
"value": "self.outputs.REPORT_ID"
},
"name": {
"type": "input",
"value": "Open training report"
}
}
}
}
}

References