Skip to navigation

Convert model

Overview

Converts the pickled PyTorch checkpoint (.pt, .pth) of a model version into safe weights, a config.json and a model.safetensors, and adds them to the same version beside the original file.

With Safe weights only on, nodes refuse pickle files, because loading one runs code. A converted version loads there, and keeps its id, so flows, aliases and evaluations that name it keep working.

A Business node: OvalBee Cloud and self-hosted installations on the Business plan have it. A Community installation does not, and shows a flow’s Convert model node as unavailable; with Safe weights only off there, a pickle loads as it is and needs no conversion.

Model version Convert model Same version, safe weights added

How it works

1

Asks OvalBee to convert the version. The conversion starts, or the one already under way for that version is joined, or a failed one is started over.

2

Waits while the conversion runs as a task of its own, in a sandbox with no access to your workspace, then while a second task checks the converted files and adds them to the version, and logs both stages.

3

Returns the same version on Model once the converted files are added to it.

FAQ

It passes through unchanged. Weights that are already safetensors or ONNX need no conversion, and the run ends at once.

OvalBee converts a model before any run that takes it starts, this node’s included: the run shows “Waiting for model conversion”, then passes the converted version on. A version whose conversion failed is refused at once with the reason; Retry on the version’s warning starts it over.

Ultralytics YOLO detection and segmentation checkpoints; timm classifiers, either bare state dicts or the checkpoints timm’s trainer writes; LibreYOLO YOLOv9 and LibreYOLO9E2E detectors, sizes t, s, m and c; RF-DETR Nano, Small, Medium and Large detectors, as the authors publish them or as rfdetr’s own training writes them; SparseInst and MaskDINO checkpoints; Grounding DINO checkpoints as MMDetection saves them; the SAM 2.1, SAM3 and ClickSEG checkpoints their authors publish, or fine-tunes of them; and DEIM, RT-DETR, EdgeCrafter and GTR checkpoints as their authors publish them or their training code writes them. A YOLO checkpoint must use an architecture Ultralytics ships, such as yolo11n or yolov8s-seg. A SparseInst, MaskDINO, Grounding DINO, DEIM, RT-DETR, EdgeCrafter or GTR checkpoint records no architecture, so the model version names it, and the weights must be exactly that network, such as sparse_inst_r50_giam, maskdino_ade20k, grounding_dino_swin_t or deim_dfine_l. The classes are the version’s: for SparseInst, MaskDINO, DEIM, RT-DETR, EdgeCrafter and GTR as many as the checkpoint predicts, for Grounding DINO any. A checkpoint of any other framework fails with “no conversion recipe”.

No. The checkpoint is read with a restricted reader that builds only tensors and plain data, and the file is refused when it names any other code. The reading happens in a sandbox without credentials or access to your workspace. The task that adds the converted files to the version checks them as data and never runs them either.

The checkpoint names Python code that a checkpoint of its framework does not hold, such as a custom class, or code meant to run when the file is opened. The error names it. Such a file is never converted.

Its network differs from every architecture its framework builds in OvalBee, for example a YOLO with an extra detection head, or an RF-DETR trained with other attention windows than its size has. Only those architectures can be converted, with any number of classes.

The architecture, task, class names and input size come from the checkpoint where it records them, and from the version otherwise. A YOLO or LibreYOLO checkpoint carries all of them. A timm checkpoint needs the version to name its architecture unless timm’s trainer wrote it, and takes the class names from the version. An RF-DETR checkpoint takes its input size from its weights, and its architecture and class names from the version unless rfdetr’s own training recorded them. A DEIM, RT-DETR, EdgeCrafter or GTR checkpoint records none of them: its architecture, class names and input size come from the version, and the number of classes from its weights. A SAM 2.1, SAM3 or ClickSEG checkpoint records none of them: the version must name its architecture the way the catalog entry does, such as sam2.1_hiera_tiny, sam3 or resnet34_1, and the weights must be that architecture’s. These models name nothing they segment, so the converted version has no classes. The run log notes where the checkpoint and the version disagree.

Not by itself. A conversion that fails, whether the file cannot be converted, a download or an upload failed, or the converted files could not be added to the version, ends failed with the reason, and Retry on the version’s warning converts the model again. With Safe weights only off, running this node again on a failed version starts the conversion over.

Inputs

Model
modelRequired

Model version to convert. A version whose weights are already safe passes through unchanged. Key: MODEL.

Outputs

Model
model

The same version, as <model id>@<version id>, now holding safe weights beside its original checkpoint. Wire it into the Model input of a predict, train, export or evaluate node. Key: MODEL.

JSON config

Machine-readable node interface for automation and advanced usage.

{
"name": "Convert model",
"description": "Converts a model version's pickled PyTorch checkpoint into safe weights, added to the same version, and passes the version on.",
"category": "Models",
"namespace": "ovalbee",
"templateKey": "models/general/convert_model",
"version": "v1",
"inputs": [
{
"key": "MODEL",
"label": "Model",
"type": "model",
"description": "Model version to convert. A version whose weights are already safe passes through unchanged.",
"required": true,
"default": null,
"visibleWhen": null
}
],
"outputs": [
{
"key": "MODEL",
"label": "Model",
"type": "model",
"description": "The same version, as `<model id>@<version id>`, now holding safe weights beside its original checkpoint. Wire it into the Model input of a predict, train, export or evaluate node.\n",
"artifact": false,
"badge": false,
"badgeOpens": null,
"hidden": false
}
],
"runtime": {
"type": "docker",
"devices": [
"cpu"
],
"dockerImage": "cr.ovalbee.com/ovalbee-ee/node-convert-model-runner:0.1.0"
}
}