Principle:Roboflow Rf detr Finetuned Model Loading
| Knowledge Sources | |
|---|---|
| Domains | Object_Detection, Transfer_Learning |
| Last Updated | 2026-02-08 15:00 GMT |
Overview
The process of loading a fine-tuned model checkpoint with custom class names and counts for inference on domain-specific data.
Description
After fine-tuning, the model checkpoint contains both the learned weights and metadata (class names, architecture config). Loading a fine-tuned model differs from loading pretrained weights in several ways:
- The class count may differ from the original 90 COCO classes
- Custom class names are embedded in the checkpoint's args.class_names
- The detection head dimensions must match the checkpoint's class count
The initialization process automatically detects class count mismatches and reinitializes the detection head before loading weights.
Usage
Use this principle when running inference with a model that was fine-tuned on a custom dataset. Point pretrain_weights to the checkpoint_best_total.pth from training.
Theoretical Basis
Fine-tuned models store their learned representations in checkpoint files. The loading process must correctly restore:
- Architecture state (matching dimensions for all layers)
- Class-specific parameters (detection head weights for the fine-tuned classes)
- Metadata (class names for interpreting predictions)