tao-train-dinov3
DINOv3 continual self-supervised pre-training. Domain-adapts public DINOv3 ViT backbones
- 01Installs
- New
- 02Files scanned
- 15
Security scan
Scan passedNo risky patterns were found in the scanned files.
Content sha256 4ff7b090e079c34a… — run codexguild_scan_skills after installing to verify your local copy.
Static analysis is a first line of defense, not a guarantee. Read the source
SKILL.md
DINOv3
Standalone install? If this session was not initialized by the TAO skill bank plugin, run the
tao-setupskill first.
Use this skill to continue self-supervised training of a DINOv3 backbone on unlabeled images, then convert, export, or run inference with a trained teacher checkpoint.
Quick Start (docker run)
Docker-native launch — no TAO SDK and no Python on the host. Use the local Docker/platform skill instead when it gives a stricter environment-specific command (non-root UID mapping, cache redirects, remote daemons).
TAO_PYT_IMAGE_DEFAULT=nvcr.io/nvidia/tao/tao-toolkit:7.3.0-pyt # versions-key: images.tao_toolkit.pyt
TAO_PYT_IMAGE="${TAO_PYT_IMAGE:-$TAO_PYT_IMAGE_DEFAULT}"
RUN_ROOT="${RUN_ROOT:-$PWD}"
DOCKER_COMMON=(
--rm --gpus all --shm-size=8g
--shm-size=8g
--ulimit memlock=-1
--ulimit stack=67108864
-v "$RUN_ROOT/data:/data:ro"
-v "$RUN_ROOT/specs:/specs:ro"
-v "$RUN_ROOT/results:/results"
)
Train:
docker run "${DOCKER_COMMON[@]}" "$TAO_PYT_IMAGE" \
dinov3 train -e /specs/train.yaml
Inference:
docker run "${DOCKER_COMMON[@]}" "$TAO_PYT_IMAGE" \
dinov3 inference -e /specs/inference.yaml
Export:
docker run "${DOCKER_COMMON[@]}" "$TAO_PYT_IMAGE" \
dinov3 export -e /specs/export.yaml
Convert:
docker run "${DOCKER_COMMON[@]}" "$TAO_PYT_IMAGE" \
dinov3 convert -e /specs/convert.yaml
Every action takes its spec with -e; results_dir is set in the spec or
overridden on the command line. Mount any pretrained-weights directory the spec
references, and keep every in-container path consistent across actions.
Configuration
Use schemas/<action>.schema.json for supported fields, defaults, ranges, and options. Start from the matching references/spec_template_<action>.yaml.
Training is AutoML-enabled. Read references/skill_info.yaml and resolve an explicit automl_policy or user request before training. Default to automl_policy: on; requests such as "disable AutoML", "no HPO", or "plain training" mean off for that run. When it is on and the train schema and template are packaged, route training through nvidia-tao-toolkit:tao-run-automl. Use direct training only when the policy is off or those files are missing, and report the missing-file limitation. Non-train actions remain in this skill.
Treat train_loss as an optimization signal; use downstream evaluation when selecting a checkpoint for deployment.
For method background or tuning ideas, optionally read:
references/dinov3-method.mdreferences/dinov3-recipes.md
Core workflow
- Obtain a compatible DINOv3 checkpoint in timm or TAO format.
- Point
dataset.train_dataset.images_dirto a directory of unlabeled images. - Configure the backbone, training scale, and output location.
- Run training and evaluate useful teacher checkpoints on data representative of the downstream task.
- Use the selected teacher checkpoint with
convert,export, orinference.
Provide either train.pretrained_model_path for a new run or train.resume_training_checkpoint_path to resume an existing run.
Essential fields
| Purpose | Spec field |
|---|---|
| Training images | dataset.train_dataset.images_dir |
| Initial weights | train.pretrained_model_path |
| Resume checkpoint | train.resume_training_checkpoint_path |
| Backbone | model.backbone.teacher_type, model.backbone.student_type |
| Training scale | dataset.batch_size, train.num_gpus, train.num_nodes |
| Output directory | results_dir |
| Conversion input | convert.checkpoint |
| Export input | export.checkpoint |
| Inference inputs | inference.checkpoint, dataset.test_dataset.images_dir |
Example train settings:
model:
backbone:
teacher_type: vit_b
student_type: vit_b
rope_theta: 100.0
dataset:
train_dataset:
images_dir: /path/to/unlabeled/images
batch_size: 16
train:
pretrained_model_path: /path/to/dinov3/weights
num_epochs: 10
num_gpus: 1
Supported image extensions include jpg, jpeg, png, ppm, bmp, pgm, tif, tiff, and webp. Keep evaluation data separate from training data when measuring downstream quality.
Every dataset.*.images_dir value must be an extracted image folder. Managed
archive-backed sources use runtime: extracted_folder, which unpacks the source
before injecting the directory into the spec. For direct Docker or TAO CLI runs,
extract .tar, .tar.gz, .tgz, or .zip inputs before launch.
Checkpoints
| File | Use |
|---|---|
model_epoch_*_step_*.pth | Resume training, or export its EMA teacher |
teacher_epoch_*_step_*.pth | Convert, export, inference, or downstream evaluation |
student_epoch_*_step_*.pth | Diagnostics |
For export, prefer a selected stripped teacher_epoch_*_step_*.pth. Export also accepts
a selected full model_epoch_*_step_*.pth and deterministically selects and logs
teacher.backbone. Inference requires a stripped teacher checkpoint. Do not
substitute dinov3_model_latest.pth without evaluating that milestone.
Training loss does not directly measure downstream representation quality. When possible, compare candidate teacher checkpoints using metrics relevant to the target task.
For convert, export, and inference, copy the training-time backbone configuration into the action spec, including rope_theta. Stripped checkpoints do not restore the RoPE frequency base, so falling back to the default can change the trained model's behavior.
Key options
model.backbone.teacher_typeandstudent_typesupportvit_s,vit_s_plus,vit_b,vit_l,vit_h_plus, andvit_7b.- When
model.distill.enable: false, the teacher and student backbone types must match. model.backbone.rope_thetacontrols the rotary frequency base. It defaults to100.0and is tunable; changing it alters positional encoding, so evaluate the resulting checkpoint for the intended task.model.centering_methodsupportssinkhornandsoftmax.model.gram.*controls optional Gram anchoring.model.lora.*enables parameter-efficient continual pre-training. The default targets the attentionqkvandprojprojections;num_last_blocks: 0adapts every transformer block.model.preservation.*adds CLS-token MSE and cosine losses against the frozen anchor teacher. It is recommended with LoRA when global embedding quality matters.train.log_every_n_stepscontrols step-level loss visibility and defaults to1, so short smoke runs emit component and preservation losses.train.precisiondefaults to16-mixed; choose precision based on hardware and measured quality.train.use_custom_attention: falseuses native attention when custom attention is unavailable.- Crop and export dimensions need to be divisible by
model.backbone.patch_size.
Distributed training
For iterative GRIT or multi-task weakness mining from an unlabeled pool followed
by DINOv3 SSL retraining, use the related tao-run-dinov3-ssl-deft application.
Ordinary pretraining and fine-tuning remain in this model skill.
Use train.num_gpus, train.gpu_ids, train.num_nodes, and train.distributed_strategy. Start with auto; use ddp or fsdp when appropriate for the selected backbone, resolution, and available memory.
Common issues
- Checkpoint load failure: verify that the checkpoint is DINOv3 and that its backbone matches the configured teacher and student types.
- No images found or archive rejected: pass an extracted image folder to
dataset.*.images_dir, not an archive file. - Out of memory: reduce batch size or image resolution, or use a sharded distributed strategy.
- Custom-attention failure: set
train.use_custom_attention: false. - Deterministic-backward failure: xformers memory-efficient attention does not provide a deterministic backward kernel; use
train.cudnn.deterministic: false. - Grid-size error: choose crop and export dimensions divisible by the patch size.
- Unexpected inference keys: use a stripped
teacher_epoch_*_step_*.pthcheckpoint. - Full-checkpoint export: a selected
model_epoch_*_step_*.pthis supported; export selects and logs its EMAteacher.backbone. - Resume mismatch: the SSL dataloader is not step-resumable, so resume from an epoch/checkpoint boundary when reproducibility matters.
Files
15- SKILL.md
07d898e0cd8.8 KB - evals/evals.json
864a1b4aa62.2 KB - references/dinov3-method.md
ac5e905fef2.3 KB - references/dinov3-recipes.md
9fe0ff19c52.9 KB - references/skill_info.yaml
ca2f4a35623.5 KB - references/spec_template_convert.yaml
ec56cf6c072.6 KB - references/spec_template_export.yaml
f3a56db2b32.5 KB - references/spec_template_inference.yaml
240c4229772.3 KB - references/spec_template_train.yaml
71397dc6903.9 KB - references/spec_template_train_highres.yaml
8e28a8ba2e3.3 KB - schemas/convert.schema.json
cb9c9c615856.0 KB - schemas/export.schema.json
3142a74bec56.9 KB - schemas/inference.schema.json
e415ff256056.9 KB - schemas/manifest.json
d3c5bd877c19.8 KB - schemas/train.schema.json
68a96e8b6154.1 KB
Agent reviews
0No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.
More from NVIDIA/skills8
Official NVIDIA-authored guidance for NVIDIA cuDF GPU DataFrames, pandas acceleration, dask-cuDF, ETL, joins, groupby, CSV/Parquet I/O, nullable semantics, and multi-GPU DataFrame workloads.
Use when asked to install, deploy, run, validate, troubleshoot, or stop NVIDIA AI-Q Blueprint infrastructure.
Use when asked to run deep research or AI-Q research through a reachable NVIDIA AI-Q Blueprint backend.
Customize NVIDIA Nemotron Voice Agent's Generic Pipecat example for healthcare appointment, five-field patient intake, or custom tool-calling workflows without a separate backend.
Calibrate a new dataset from live RTSP camera streams via the AutoMagicCalib REST API. Use when the user provides RTSP URLs or asks to calibrate live cameras; VIOS records clips, AMC ingests them, then runs calibration.
Run end-to-end calibration on the shipped sample dataset (sdg_08_2_sample_data_010926.zip) against a running AMC microservice. Use when user says 'test sample dataset', 'run sample calibration', 'verify AMC install', or 'launch and test'.
Calibrates pre-recorded `cam_*.mp4` datasets through the AutoMagicCalib REST API. Use for user-supplied local MP4s; route live RTSP streams to `amc-run-rtsp-calibration`.
Launch AutoMagicCalib microservice and web UI from NGC release images via Docker Compose. Use when user says 'deploy auto calibration', 'launch auto calibration', 'launch AMC', 'start MS+UI', or 'set up auto-magic-calib'. Requires NGC API key.
Related ai-ml skillsscan passed
Pair a remote AI agent with your browser. Use for: pair with agent, connect remote agent. (gstack)
Provides guidance for troubleshooting Apache Airflow DAGs (failed DAG runs and task instances) in Managed Service for Apache Airflow (MSAA; formerly Cloud Composer). Use when figuring out reasons for DAG run or task instance failures. Don't use when looking for overall recommendations for Managed Ai
Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode
AI demos and GPU compute with Gradio Spaces and Hugging Face Spaces ZeroGPU. Use when writing or reviewing code that uses `@spaces.GPU`, configuring `python_version` or `requirements.txt` for a ZeroGPU Space, or handling ZeroGPU-specific code constraints — pickle-based process isolation, `gr.State`
Query Elastic Context Engine AI Indices, and the Knowledge Indicators (KIs) they store. Use when asked to search, explore, count, or answer questions from an AI Index / KI / Context Engine knowledge index, and when writing the ES|QL that queries one.
Provisions Amazon WorkSpaces Applications (AppStream 2.0) environments, from images and image builders to fleets and stacks, through a guided flow, for an AI agent or for human users. Covers turning a described workflow into configuration (instance type, ALWAYS_ON vs ON_DEMAND, scaling, session time