tao-train-dino
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDINO
DINO
DINO (DETR with Improved DeNoising Anchor Boxes) for 2D object detection. Transformer-based detector with denoising training, multi-scale features, and optional distillation support.
Uses pretrained backbone weights (e.g. ResNet-50 ImageNet). Set for backbone-only or for full model.
model.pretrained_backbone_pathtrain.pretrained_model_pathFor TAO Deploy TensorRT actions (, TensorRT , and
TensorRT ), read first. Deploy spec templates live
in this skill's folder with the
prefix.
gen_trt_engineevaluateinferencereferences/tao-deploy-dino.mdreferences/spec_template_deploy_*.yamlGenerated TAO Core schemas are packaged in (with listing actions); each schema emits a matching . See for the full dataclass-schema, spec-template, data-sources, and parent-model inference details used by SDK orchestration.
schemas/<action>.schema.jsonschemas/manifest.jsonreferences/spec_template_<action>.yamlreferences/sdk_orchestration.mdDINO(带改进去噪锚框的DETR)用于2D目标检测。这是一款基于Transformer的检测器,支持去噪训练、多尺度特征,还可选支持蒸馏。
使用预训练的骨干网络权重(如ResNet-50 ImageNet)。若仅需骨干网络预训练权重,设置;若需完整模型预训练权重,设置。
model.pretrained_backbone_pathtrain.pretrained_model_path对于TAO Deploy TensorRT相关操作(、TensorRT 和TensorRT ),请先阅读。部署规格模板存放在本技能的文件夹下,文件名以为前缀。
gen_trt_engineevaluateinferencereferences/tao-deploy-dino.mdreferences/spec_template_deploy_*.yaml生成的TAO Core schema打包在中(列出所有操作);每个schema都会生成对应的文件。有关SDK编排使用的数据类schema、规格模板、数据源和父模型推理的详细信息,请查看。
schemas/<action>.schema.jsonschemas/manifest.jsonreferences/spec_template_<action>.yamlreferences/sdk_orchestration.mdTrain Action Policy
训练操作策略
This model is AutoML-enabled at the model layer. Before handling any train-stage request, read and resolve the run override from either an explicit value or the user's workflow request. Treat phrases like "turn off AutoML", "disable AutoML", "no HPO", or "plain training" as for this run only; otherwise default to . When , , and both and are packaged, route the train action through by default with this model's . Preserve workflow/application overrides for datasets, specs, output directories, GPU/platform settings, parent checkpoints, and . Use direct model training only when or the packaged train schema/template is missing; in the missing-schema case, report that AutoML is enabled but not runnable for this model until schemas are generated.
references/skill_info.yamlautoml_policyautoml_policy: offautoautoml_policy: autoautoml_enabled: trueschemas/train.schema.jsonreferences/spec_template_train.yamltao-skill-bank:tao-run-automlskill_dirautoml_policyautoml_policy: offNon-train actions such as , , , and deploy flows stay in this model skill. The per-run override does not change model metadata.
evaluateinferenceexportautoml_policy该模型在模型层支持AutoML。处理任何训练阶段请求前,请先阅读,并通过显式的值或用户的工作流请求确定运行覆盖规则。将“turn off AutoML”、“disable AutoML”、“no HPO”或“plain training”这类表述视为本次运行的;否则默认设置为。当、,且和均已打包时,默认将训练操作路由至,并传入该模型的。保留数据集、规格、输出目录、GPU/平台设置、父检查点和的工作流/应用覆盖规则。仅当或打包的训练schema/模板缺失时,才使用直接模型训练;若schema缺失,需告知用户AutoML已启用,但在生成schema前无法针对该模型运行。
references/skill_info.yamlautoml_policyautoml_policy: offautoautoml_policy: autoautoml_enabled: trueschemas/train.schema.jsonreferences/spec_template_train.yamltao-skill-bank:tao-run-automlskill_dirautoml_policyautoml_policy: off非训练操作(如、、及部署流程)仍在本模型技能中执行。每次运行的覆盖规则不会更改模型元数据。
evaluateinferenceexportautoml_policyTraining Requirements
训练要求
The agent MUST read this section before generating any training or AutoML script for DINO.
- Dataset type: object_detection
- Formats: coco, coco_raw
- Accepted dataset intents: training, evaluation, testing, calibration
- Monitoring metric: val_mAP50
Required datasets — MUST resolve both:
| Dataset | Required | Why |
|---|---|---|
| Train dataset URI | Yes | Training data (COCO format) |
| Validation dataset URI | Yes — ALWAYS | DINO unconditionally builds a val dataloader. Omitting |
Required inputs before generating any training spec:
- Train dataset URI — S3 path to COCO-format training data
- Validation dataset URI — S3 path to COCO-format val data (can be same as train)
- — How many object classes? Default 91 (COCO). Must be >=
num_classes. Too low causesmax(category_id) + 1.CUDA error: device-side assert triggered
Resolve these from the user request or the default profile below. Prompt only
for values that are still missing after applying the profile rules.
Bankable local default profile for DINO AutoML smoke runs:
Use this profile only when the user asks to run DINO AutoML and does not provide
dataset or class-count inputs. This profile is intentionally small and local to
this skill bank; it is for smoke/iteration runs, not a production benchmark.
Do not search previous runners, logs, session state, shell history, or the home
directory to recover these values.
python
DINO_AUTOML_PROFILE = {
"train_dataset_uri": "s3://nvcf-storage-handling/data/tao_od_synthetic_subset_train_no_convert",
"validation_dataset_uri": "s3://nvcf-storage-handling/data/tao_od_synthetic_subset_val_no_convert",
"object_classes": 4,
"dataset_num_classes": 5,
"image_archive": "images.tar.gz",
"annotation_file": "annotations.json",
"max_recommendations": 10,
"train_num_epochs": 10,
"train_checkpoint_interval": 10,
"train_validation_interval": 1,
"train_num_gpus": 1,
}If the user supplies any dataset URI or class-count value, prefer the user value
and ask for any remaining required DINO value. Do not partially mix a user's
custom dataset with this profile's class count unless the user confirms it.
Do not prompt for image layout for the standard DINO dataset. The standard
TAO DINO dataset artifact is plus . Use
in the remote spec override. The SDK downloads the
archive and rewrites the runtime spec to the extracted folder named after the
archive stem ( -> ). Only deviate if the user explicitly
provides a different image artifact name.
images.tar.gzannotations.jsonimages.tar.gzimage_dirimages.tar.gzimagesAgent在生成任何DINO训练或AutoML脚本前,必须阅读本节内容。
- 数据集类型: object_detection
- 格式: coco, coco_raw
- 可接受的数据集用途: training, evaluation, testing, calibration
- 监控指标: val_mAP50
必填数据集 — 必须同时满足:
| 数据集 | 是否必填 | 原因 |
|---|---|---|
| 训练数据集URI | 是 | 训练数据(COCO格式) |
| 验证数据集URI | 是 — 必须提供 | DINO会无条件构建验证数据加载器。无论指标或工作流如何,若省略 |
生成训练规格前需确认的必填输入:
- 训练数据集URI — COCO格式训练数据的S3路径
- 验证数据集URI — COCO格式验证数据的S3路径(可与训练数据集相同)
- — 目标类别数量?默认值为91(COCO数据集)。必须大于等于
num_classes。数值过低会触发max(category_id) + 1。CUDA error: device-side assert triggered
从用户请求或下方默认配置中获取以上信息。仅在应用配置规则后仍有缺失值时,才向用户询问。
DINO AutoML冒烟测试的本地默认配置:
仅当用户要求运行DINO AutoML且未提供数据集或类别数量输入时,才使用此配置。该配置特意设置为小型本地配置,仅用于冒烟测试/迭代运行,而非生产基准测试。请勿从之前的运行记录、日志、会话状态、shell历史或主目录中恢复这些值。
python
DINO_AUTOML_PROFILE = {
"train_dataset_uri": "s3://nvcf-storage-handling/data/tao_od_synthetic_subset_train_no_convert",
"validation_dataset_uri": "s3://nvcf-storage-handling/data/tao_od_synthetic_subset_val_no_convert",
"object_classes": 4,
"dataset_num_classes": 5,
"image_archive": "images.tar.gz",
"annotation_file": "annotations.json",
"max_recommendations": 10,
"train_num_epochs": 10,
"train_checkpoint_interval": 10,
"train_validation_interval": 1,
"train_num_gpus": 1,
}若用户提供了任何数据集URI或类别数量值,优先使用用户提供的值,并询问剩余必填的DINO参数。除非用户确认,否则请勿将用户的自定义数据集与本配置的类别数量混合使用。
请勿询问标准DINO数据集的图像布局。 标准TAO DINO数据集工件为加。在远程规格覆盖中使用。SDK会下载该归档文件,并将运行时规格重写为归档文件名对应的提取文件夹( -> )。仅当用户明确提供不同的图像工件名称时,才可以偏离此规则。
images.tar.gzannotations.jsonimage_dirimages.tar.gzimages.tar.gzimagesSpec Overrides, Datasets, and Parameters
规格覆盖、数据集与参数
Data source overrides are mandatory for every action — DINO's has empty because the runner cannot auto-resolve array-of-objects spec keys. The agent MUST build data source paths and include them in .
config.jsondata_sourcesspec_overridesSee for: the per-action dataset requirements table; the mandatory blocks for , , , , , , and ; checkpoint resolution via inference and the fallback; the COCO dataset format and archive-stem rules; per-action data-source layouts; the full Important Parameters list (num_classes, backbone and its supported values, lr/lr_backbone, num_epochs, lr_steps, num_queries, batch_size); Default Values (num_epochs 10, batch_size 4, learning_rate 2e-4, lr_backbone 2e-5, num_classes 91, backbone resnet_50); Evaluate Defaults; Export Defaults (input 640x640, opset 17, trt_data_types [FP32, FP16, INT8], trt_workspace_size_mb 1024); and Hardware guidance (1 GPU minimum, 4 recommended, 24GB+ A100). Full TAO Deploy reference: tao-deploy-dino.
references/spec_overrides.mdspec_overridestrainevaluateexportgen_trt_engineinferencequantizedistillparent_modelresults_dir/train/dino_model_latest.pthimages.tar.gzWhen generating an spec, carry forward the winning AutoML rec's structural model settings (, , , ) so the checkpoint shape matches the evaluation model.
evaluatemodel.backbonemodel.num_queriesmodel.dropout_ratiodataset.num_classes数据源覆盖对每个操作都是强制性的 — DINO的中为空,因为运行器无法自动解析对象数组类型的规格键。Agent必须构建数据源路径,并将其包含在中。
config.jsondata_sourcesspec_overrides有关以下内容,请查看:各操作的数据集要求表;、、、、、和的必填块;通过推理和备选方案解析检查点;COCO数据集格式和归档文件名规则;各操作的数据源布局;完整的重要参数列表(num_classes、骨干网络及其支持值、lr/lr_backbone、num_epochs、lr_steps、num_queries、batch_size);默认值(num_epochs为10,batch_size为4,learning_rate为2e-4,lr_backbone为2e-5,num_classes为91,backbone为resnet_50);评估默认值;导出默认值(输入尺寸640x640,opset为17,trt_data_types为[FP32, FP16, INT8],trt_workspace_size_mb为1024);以及硬件指南(最少1块GPU,推荐4块,需24GB+显存的A100)。完整TAO Deploy参考文档:tao-deploy-dino。
references/spec_overrides.mdtrainevaluateexportgen_trt_engineinferencequantizedistillspec_overridesparent_modelresults_dir/train/dino_model_latest.pthimages.tar.gz生成规格时,请沿用AutoML最优推荐的结构化模型设置(、、、),确保检查点形状与评估模型匹配。
evaluatemodel.backbonemodel.num_queriesmodel.dropout_ratiodataset.num_classesError Patterns
错误模式
Common failures include CUDA OOM, , spec/schema merge errors, dataset-smaller-than-batch, vs mismatch, on images or missing val data, from low , S3 inputs not downloaded, and evaluate checkpoint not found at the result root. See for each error pattern and its fix.
num_select < num_queries * num_classesreturn_interm_indicesnum_feature_levelsFileNotFoundErrorCUDA device-side assertnum_classesreferences/troubleshooting.md常见故障包括CUDA内存不足、、规格/schema合并错误、数据集小于批量大小、与不匹配、图像文件未找到或验证数据缺失导致的、过低导致的、S3输入未下载、评估检查点在结果根目录未找到等。有关每种错误模式及其修复方法,请查看。
num_select < num_queries * num_classesreturn_interm_indicesnum_feature_levelsFileNotFoundErrornum_classesCUDA device-side assertreferences/troubleshooting.mdAutoML / HPO Notes
AutoML / HPO说明
AutoML runs training — all Training Requirements above apply, and the no-input case uses . Do not inspect previous AutoML runs to infer dataset URIs, , recommendation count, or interval settings. Use explicit with and a custom reading rather than . See for the recommended metric extractor, hyperparameter list, , the note, and the backbone-constraint guidance.
DINO_AUTOML_PROFILEnum_classesmetric="mAP50"direction="maximize"metric_extractorValidation mAP50metric="kpi"references/automl.mdcustom_param_rangestrain.optim.weight_decayAutoML会执行训练 — 需满足上述所有训练要求,无输入时使用。请勿检查之前的AutoML运行记录来推断数据集URI、、推荐数量或间隔设置。使用显式的和,并使用自定义读取,而非。有关推荐的指标提取器、超参数列表、、说明和骨干网络约束指南,请查看。
DINO_AUTOML_PROFILEnum_classesmetric="mAP50"direction="maximize"metric_extractorValidation mAP50metric="kpi"custom_param_rangestrain.optim.weight_decayreferences/automl.mdOptional: running via the TAO SDK
可选:通过TAO SDK运行
The SDK orchestration, S3 I/O wrapping, AutoML internals, spec-template generation, the data-sources gap, the declarations, and the full per-action spec-param / parent-model inference mapping table are documented in . Skip this when running locally with .
script_runnerconfig.jsoninputsreferences/sdk_orchestration.mddocker runSDK的编排、S3 I/O封装、AutoML内部机制、规格模板生成、数据源缺口、的声明以及完整的各操作规格参数/父模型推理映射表,均记录在中。使用本地运行时可跳过此部分。
script_runnerconfig.jsoninputsreferences/sdk_orchestration.mddocker run