技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
training【数据与研究】Plan, validate, launch, monitor, and safely resume NanoTrack training with explicit data, configuration, CUDA, and runtime gates.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this operating skill for NanoTrack training requests in the SiamTrackers collection: preparing cropped training data, editing a copied YAML config, validating model/data compatibility, selecting a safe launch, interpreting loss and checkpoint behavior, or planning recovery from a failed run.
NanoTrack is the maintained end-to-end workflow represented here. Treat other tracker directories as historical snapshots unless another skill says otherwise.
Route these requests instead:
template/track, and frame-by-frame use:
inference..cuda() and moves all four training tensors with .cuda(); CUDA: false
does not create a CPU training path.rank=0, world_size=1 through a stub.
Distributed classes are present, but stock multi-process training is not
enabled. Do not put the unmodified entry point behind torchrun.Establish a NanoTrack-compatible project root, copied config path, requested variant, data ownership, GPU allocation, run directory, and completion criterion. Keep every relative config path anchored to the launch root.
If the request changes V1/V2/V3 architecture or head selection, consult variant-catalog first. A YAML filename alone does not select every variant-specific implementation detail.
Read configuration.md. Confirm BAN.BAN,
backbone/adjust/head channels, training geometry, enabled dataset records,
augmentation rates, target counts, scheduler, and output paths.
Run the bundled read-only checker before importing the training package:
SKILL_DIR=/path/to/this/training
python "$SKILL_DIR/scripts/check_training_config.py" \
--config "$CFG" \
--project-root "$NANOTRACK_ROOT" \
--world-size 1 \
--require-cuda
Treat every checker error as a launch blocker. Review warnings manually; geometry warnings can be intentional for a matched variant, but unchecked files and non-divisible epoch sizing need explicit acceptance.
Perform the data and CUDA gates in
workflows.md. In particular, probe one annotation
record and its exact crop file, then load one BANDataset sample before a
long run. Do not use a benchmark dataset layout as a training crop layout.
Start with single-process execution and a unique copied config. Set
TRAIN.LOG_DIR and TRAIN.SNAPSHOT_DIR to run-specific locations. Use an
explicitly selected free GPU; an available GPU is not necessarily idle.
Watch startup through config merge, model creation, data indexing, first forward/backward, first scalar write, and first periodic log. Stop on silent invalid-loss skipping, repeated worker failures, or unexpected output-path reuse.
Resume only after matching the config, variant, optimizer parameter groups, and checkpoint epoch. Read the transition-epoch warning in workflows.md; scheduler state is reconstructed, not restored.
Record the exact config, command, environment probe, data identity, seed, GPU assignment, and accepted warnings with the run outputs.
The dataset returns a mapping containing:
| Key | Meaning |
|---|---|
template | Float32 CHW crop, normally 3 x TRAIN.EXEMPLAR_SIZE x TRAIN.EXEMPLAR_SIZE |
search | Float32 CHW crop, normally 3 x TRAIN.SEARCH_SIZE x TRAIN.SEARCH_SIZE |
label_cls | Int64 point labels: -1 ignored, 0 negative, 1 positive |
label_loc | Float32 4 x OUTPUT_SIZE x OUTPUT_SIZE left/top/right/bottom distances |
bbox | Augmented search-box corners; returned for inspection, not consumed by the model loss |
The training forward consumes the first four keys, moves them to CUDA, and
returns total_loss, cls_loss, and loc_loss. The weighted total is:
total_loss = TRAIN.CLS_WEIGHT * cls_loss
+ TRAIN.LOC_WEIGHT * loc_loss
The loader uses TRAIN.BATCH_SIZE, TRAIN.NUM_WORKERS, pinned memory, and an
internally shuffled index list. It does not pass shuffle=True to the
DataLoader.
For each name in DATASET.NAMES, require a non-empty ROOT, ANNO,
FRAME_RANGE, and NUM_USE. Relative paths resolve from the NanoTrack launch
root. The maintained GOT record defaults to:
ROOT: data/GOT-10k/crop511
ANNO: data/GOT-10k/train.json
A crop is addressed as:
ROOT/<video>/<six-digit-frame>.<track>.x.jpg
The annotation must map video to track to six-digit frame keys and valid boxes. Read the exact schema and sampling behavior in configuration.md.
The historical training launcher is a long-running, CUDA/data-bound source entry point. This skill intentionally does not bundle or execute it. After the static and real-batch gates pass, an operator with the selected source implementation may invoke its documented launcher from that checkout using an explicit config, a selected physical GPU exposed as logical device 0, and run-specific log/snapshot paths. The source launcher is an external execution dependency, not a runtime file in this skill.
This command starts a long-running job and must be approved after the gates pass. Use the bundled checker for dry-run/config validation; the historical launcher has no safe dry-run or max-step option.
Rank 0 creates TRAIN.LOG_DIR, writes logs.txt, and opens a TensorBoard
writer there. It creates TRAIN.SNAPSHOT_DIR and saves
checkpoint_e<N>.pth at epoch transitions with:
epochstate_dictoptimizerThe scheduler is absent from the checkpoint. TRAIN.RESUME restores model,
optimizer, and epoch; TRAIN.PRETRAINED loads model weights only and is ignored
when resume is set. BACKBONE.PRETRAINED, when non-empty, is loaded earlier.
Use troubleshooting.md for missing crops, annotation schema failures, worker crashes, CUDA/OOM errors, geometry or channel mismatches, invalid losses, scheduler/resume issues, and unsafe distributed launches. Escalate architecture-selection uncertainty to variant-catalog; do not repair it by guessing channels or output sizes.