AGENT SKILL

training-and-cli

Train, evaluate, configure, and validate RF-DETR datasets with the Python API or Lightning CLI.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
training-and-cli
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Train, evaluate, configure, and validate RF-DETR datasets with the Python API or Lightning CLI.
disable-model-invocation
true

02 资源文件 9

03 SKILL.md 正文

RF-DETR training and CLI

Use this sub-skill when the task is to fine-tune, evaluate, configure, or debug RF-DETR training runs. It covers the high-level Python API, the Lightning CLI, dataset layout validation, TrainConfig variants, augmentation backends, loggers, resume behavior, and distributed training.

Route by task

If the user needs... Open this
COCO, YOLO, segmentation, or keypoint dataset layout checks references/data-formats.md and scripts/validate_dataset_layout.py
model.train(...), model.evaluate(...), checkpoints, EMA, early stopping, auto batch, augmentation, loggers, or multi-GPU advice references/training-workflows.md
rfdetr fit/validate/test/predict, Lightning YAML configs, or config overrides references/cli-and-configs.md and scripts/inspect_training_config.py
Training failures, missing extras, bad schemas, resume surprises, DDP, logger credentials, or resolution errors references/troubleshooting.md

First actions

  1. Identify the model family: detection (RFDETRSmall / rfdetr-small), segmentation (RFDETRSegSmall / rfdetr-seg-small), or keypoint preview (RFDETRKeypointPreview / rfdetr-keypoint-preview).

  2. Confirm the extras. Training needs pip install "rfdetr[train]"; the Lightning CLI also needs pip install "rfdetr[train,cli]". Add augment for Albumentations/Kornia and loggers for TensorBoard/W&B/MLflow.

  3. Validate the dataset layout before long runs:

    python scripts/validate_dataset_layout.py data/my_dataset --task auto
    python scripts/validate_dataset_layout.py data/my_pose_dataset --task keypoint --infer-keypoint-schema
    
  4. Inspect the installed config surface or a bundled Lightning YAML before editing it:

    python scripts/inspect_training_config.py
    python scripts/inspect_training_config.py --config references/configs/rfdetr_small.yaml
    

Quick decision rules

  • Use the high-level RFDETR.train(**kwargs) path for ordinary fine-tuning and RFDETR.evaluate(split="test"|"val", **kwargs) for one-shot COCO metrics.
  • Use the Lightning CLI or custom PTL API when a task needs YAML-driven runs, trainer strategies, callbacks/loggers, or framework integration.
  • For multi-GPU launches, set devices="auto" or an explicit count; the default Trainer device count is one.
  • Use resume=".../last.ckpt" for full optimizer/scheduler continuity. Use lightweight .pth best checkpoints as weights or cold-continuation inputs.
  • Keypoint preview can infer COCO/YOLO pose schemas, but YOLO pose must declare kpt_shape; keypoint training supports DDP but not Kornia GPU augmentation, FSDP, or DeepSpeed.

Boundaries

  • Prediction-only outputs and label interpretation belong to ../inference-and-models/SKILL.md.
  • ONNX, TensorRT, TFLite, ExecuTorch, CoreML, and deployment artifacts belong to ../export-and-deployment/SKILL.md.
  • Contributor test policy, pre-commit, and source-repository maintenance belong to ../repository-development/SKILL.md.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351