К основному содержанию
скилл CX Codex

tao-train-mask-auto-label — скилл для Claude Code: установка

Помогает запускать обучение и инференс модели сегментации NVIDIA MAL с бэкбоном ViT-MAE. Пригодится для разметки масок по отдельным точкам или боксам.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add NVIDIA/skills --skill tao-train-mask-auto-label -a claude-code
Открыть на GitHub

Что делает tao-train-mask-auto-label

Скилл настраивает и запускает модель Mask Auto-Label (MAL) через Docker-контейнер tao-toolkit:7.3.0-pyt. Модель генерирует маски сегментации на основе минимальной разметки: точек или ограничивающих рамок. На хосте не требуются Python или TAO SDK, потому что вызовы mal train, evaluate и inference выполняются внутри изолированного контейнера.

Для работы обязательны Docker и nvidia-container-toolkit. Модель ожидает разметку в формате COCO JSON и архивы images.tar.gz. Если датасет сохранён в виде таблиц CSV, инструмент не сможет его прочесть без предварительной конвертации. Поддерживается оптимизация гиперпараметров через AutoML с максимизацией метрики mIoU. При автономной установке сначала запустите скилл tao-setup.

Какие задачи решает

  • обучить модель сегментации MAL по точкам или боксам
  • сгенерировать маски сегментации на тестовых изображениях
  • оценить качество предсказания масок по метрике mIoU
  • запустить подбор гиперпараметров через AutoML

Примеры запросов агенту

  • Обучи модель MAL на датасете с параметрами из specs/train.yaml
  • Запусти оценку модели tao-train-mask-auto-label с вычислением mIoU
  • Сгенерируй маски сегментации через mal inference для изображений из images.tar.gz

Как установить tao-train-mask-auto-label

1Через Skills CLI (Vercel)

npx skills add NVIDIA/skills --skill tao-train-mask-auto-label -a claude-code

2Вручную: положить файлы

~/.claude/skills/tao-train-mask-auto-label/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/tao-train-mask-auto-label/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о tao-train-mask-auto-label

Как установить tao-train-mask-auto-label в Claude Code?

Выполните команду npx skills add NVIDIA/skills --skill tao-train-mask-auto-label -a claude-code.

Что делает tao-train-mask-auto-label?

Скилл готовит спецификации и запускает обучение, оценку или инференс модели слабоконтролируемой сегментации MAL с архитектурой ViT-MAE.

Какие системные требования нужны для запуска?

На хосте требуются Docker и nvidia-container-toolkit. Если сессия запущена без плагина TAO skill bank, сначала нужно выполнить скилл tao-setup.

Исходный текст

SKILL.md · Apache-2.0
---
name: tao-train-mask-auto-label
description: MAL (Mask Auto-Label) for weakly-supervised segmentation. Produces segmentation masks from minimal annotations
  (point or box annotations) using a ViT-MAE backbone. Use when training, evaluating, or running inference for a TAO MAL
  model. Trigger phrases include "train MAL", "Mask Auto-Label", "weakly-supervised segmentation", "box-prompted
  segmentation", "minimal-annotation mask prediction".
license: Apache-2.0
compatibility: Requires docker + nvidia-container-toolkit.
metadata:
  version: "0.1.0"
  author: NVIDIA Corporation
allowed-tools: Read Bash
tags:
- segmentation
---

# MAL

> **Standalone install?** If this session was not initialized by the TAO skill bank plugin, run the `tao-setup` skill first (host preflight, credentials, cross-skill discovery).

MAL (Mask Auto-Label) for weakly-supervised segmentation. Produces segmentation masks from minimal annotations (e.g., point or box annotations). Uses ViT-MAE backbone.

Set train.pretrained_model_path for ViT-MAE pretrained weights.

## 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).

```bash
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:

```bash
docker run "${DOCKER_COMMON[@]}" "$TAO_PYT_IMAGE" \
  mal train -e /specs/train.yaml
```

Evaluate:

```bash
docker run "${DOCKER_COMMON[@]}" "$TAO_PYT_IMAGE" \
  mal evaluate -e /specs/evaluate.yaml
```

Inference:

```bash
docker run "${DOCKER_COMMON[@]}" "$TAO_PYT_IMAGE" \
  mal inference -e /specs/inference.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.

## Dataclass Schemas

Generated TAO Core schemas are packaged in `schemas/<action>.schema.json`, with `schemas/manifest.json` listing available actions. Each generated schema also emits `references/spec_template_<action>.yaml` from the schema top-level `default` field. AutoML enablement is declared at the model layer in `references/skill_info.yaml` via `automl_enabled`. Runnable AutoML for an action requires `schemas/<action>.schema.json` and `references/spec_template_<action>.yaml` to exist and parse. Use the packaged selected-action schema for `automl_default_parameters`, `automl_disabled_parameters`, defaults, min/max bounds, enums, option weights, math conditions, dependencies, and popular parameters. Do not expect `~/tao-core` at runtime; maintainers regenerate schemas/templates before packaging the skill bank.

## Train Action Policy

This model is AutoML-enabled at the model layer. Before handling any train-stage request, read `references/skill_info.yaml` and resolve the run override from either an explicit `automl_policy` value or the user's workflow request. Use `automl_policy: on` by default and only expose `on` / `off` in new launch prompts. Treat phrases like "turn off AutoML", "disable AutoML", "no HPO", or "plain training" as `automl_policy: off` for this run only. When `automl_policy: on`, `automl_enabled: true`, and both `schemas/train.schema.json` and `references/spec_template_train.yaml` are packaged, route the train action through `tao-skill-bank:tao-run-automl` by default with this model's `skill_dir`. Preserve workflow/application overrides for datasets, specs, output directories, GPU/platform settings, parent checkpoints, and `automl_policy`. Use direct model training only when `automl_policy: off` 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.

Non-train actions such as `evaluate`, `inference`, `export`, and deploy flows stay in this model skill. The per-run `automl_policy` override does not change model metadata.

## Training Requirements

- **Dataset type:** segmentation
- **Formats:** default
- **Monitoring metric:** mIoU
- **AutoML metric contract:** Use `mIoU` emitted by the evaluate action and
  maximize it. Compare the recorded AutoML objective with the evaluator's
  emitted `mIoU`; do not substitute training loss.

### Per-Action Dataset Requirements

| Action | Spec Key | Source | Files | List? |
|---|---|---|---|---|
| evaluate | dataset.val_img_dir | eval_dataset | images.tar.gz | No |
| evaluate | dataset.val_ann_path | eval_dataset | annotations.json | No |
| inference | inference.img_dir | inference_dataset | images.tar.gz | No |
| inference | inference.ann_path | inference_dataset | annotations.json | No |
| train | dataset.train_img_dir | train_datasets | images.tar.gz | No |
| train | dataset.train_ann_path | train_datasets | annotations.json | No |
| train | dataset.val_img_dir | eval_dataset | images.tar.gz | No |
| train | dataset.val_ann_path | eval_dataset | annotations.json | No |

### Typical Spec Overrides

Data source overrides are **mandatory for every action** — the agent MUST construct data source paths from the Per-Action Dataset Requirements table above and include them in `spec_overrides`.
MAL expects COCO-style annotation JSON plus image paths that match the JSON
`file_name` entries after the data source is prepared. Archive-only CSV/image
datasets are not compatible unless they are converted to this format first.

```python
S3_TRAIN = "s3://bucket/data/train"
S3_EVAL = "s3://bucket/data/eval"
```

**train (mandatory data sources):**
```python
{
    "train.num_gpus": 1,
    "train.gpu_ids": [
        0
    ],
    "train.num_epochs": 5,
    "train.checkpoint_interval": 5,
    "train.validation_interval": 5,
    "dataset.train_img_dir": f"{S3_TRAIN}/images.tar.gz",
    "dataset.train_ann_path": f"{S3_TRAIN}/annotations.json",
    "dataset.val_img_dir": f"{S3_EVAL}/images.tar.gz",
    "dataset.val_ann_path": f"{S3_EVAL}/annotations.json",
}
```

**evaluate (mandatory data sources):**
```python
{
    "evaluate.checkpoint": "<selected train/AutoML checkpoint>",
    "dataset.val_img_dir": f"{S3_EVAL}/images.tar.gz",
    "dataset.val_ann_path": f"{S3_EVAL}/annotations.json",
}
```

**inference (mandatory data sources):**
```python
{
    "inference.checkpoint": "<selected train/AutoML checkpoint>",
    "inference.img_dir": f"{S3_EVAL}/images.tar.gz",
    "inference.ann_path": f"{S3_EVAL}/annotations.json",
}
```

For checkpoint-dependent actions, use the model resolver declared in
`references/skill_info.yaml`. Select the exact epoch/step checkpoint requested
by the user or the best checkpoint when a best-checkpoint action is requested.
The `mal_model_latest.pth` symlink is only appropriate when the user explicitly
asks for the latest checkpoint.

## Eval Dataset

Optional. Val images and annotations configured alongside train paths.

## Important Parameters

- **model.arch**: ViT-MAE backbone variant. Default vit-mae-base/16.
  Avoid `vit-deit-tiny/16`; the current runtime rejects tiny ViT variants.
- **train.lr**: Learning rate. Default 1e-6 (very low — fine-tuning ViT).
- **dataset.crop_size**: Training crop size. Default 512. Use this key, not
  `model.crop_size`.
- **train.warmup_epochs**: Warmup epochs before full learning rate.
- **dataset.load_mask**: Whether annotations contain pre-computed segmentation
  masks. Set this to `false` for COCO annotations that contain boxes but no
  `segmentation` fields when performing training or inference without mask
  ground truth. Keep it `true` when every annotation contains segmentation
  data. AutoML validation that selects by `mIoU` requires segmentation ground
  truth and `dataset.load_mask: true`; bbox-only evaluation emits non-finite
  `mIoU` and must not be accepted as a valid AutoML objective.

## AutoML / HPO Notes

For MAL AutoML launches, keep the default smoke search space narrow and pass
`automl_hyperparameters=["train.lr", "train.wd"]`. Use conservative Bayesian
ranges around the ViT-MAE fine-tuning defaults, for example
`train.lr` from `1e-7` to `1e-5` and `train.wd` from `1e-5` to `1e-2`.
The packaged train schema marks these two parameters as the default AutoML
parameters; pass them explicitly when using a runtime that still derives MAL
search metadata from its bundled config module.

## Multi-GPU / Multi-Node

**Launch method:** Lightning-managed (single `python` process, Lightning spawns workers).

| Spec Key | Description | Default |
|----------|-------------|---------|
| `train.num_gpus` | Number of GPUs | 1 |
| `train.gpu_ids` | GPU device indices | [0] |
| `train.num_nodes` | Number of nodes | 1 |

- Multi-GPU strategy: `ddp_find_unused_parameters_true`
- No fsdp support
- **LR auto-scaling:** `lr = lr * num_devices * batch_size` (learning rate is scaled automatically by device count and batch size)

**Multi-node env vars** (set by orchestrator): `WORLD_SIZE`, `NODE_RANK`, `MASTER_ADDR`, `MASTER_PORT`, `NUM_GPU_PER_NODE`.

## Hardware

Minimum 1 GPU(s), recommended 2 GPU(s). 24GB+ (A100 recommended) VRAM per GPU. ViT-MAE backbone at crop_size=512 needs 24GB+ GPU memory.

## Error Patterns

**CUDA out of memory**: Reduce `dataset.crop_size` (512 -> 384 -> 256) or use a smaller ViT-MAE variant (base vs large).

**Key `crop_size` not in `MALModelConfig`**: The crop-size override was placed
under `model.crop_size`. Move it to `dataset.crop_size`.

## Spec Param / Parent Model Inference

Model-specific inference mappings belong in this MD file, not in `config.json`. Generated runners should read this section and apply the mappings with SDK helpers before `create_job()`. This mirrors the old microservices `infer_params.py` flow.

Inference mappings from TAO Core `mal.config.json`:

| Action | Spec Field | Inference Function | Meaning |
|---|---|---|---|
| evaluate | `evaluate.checkpoint` | `parent_model` | model file inferred from the parent job results folder |
| evaluate | `results_dir` | `output_dir` | current job results directory |
| inference | `inference.checkpoint` | `parent_model` | model file inferred from the parent job results folder |
| inference | `inference.label_dump_path` | `create_inference_result_file_mal` | MAL inference JSON path |
| inference | `results_dir` | `output_dir` | current job results directory |
| train | `train.pretrained_model_path` | `ptm_if_no_resume_model` | optional pretrained model when not resuming |
| train | `train.resume_training_checkpoint_path` | `resume_model` | exact checkpoint for resume runs |
| train | `results_dir` | `output_dir` | current job results directory |

For `parent_model` or `parent_model_folder`, pass the upstream train/export/AutoML child job id as `parent_job_id`. The SDK lists the parent result folder, filters checkpoint artifacts, and returns the selected model file or folder. Do not add these mappings back to `config.json` and do not patch generated runner scripts to guess checkpoint paths.

© NVIDIA Corporation · Apache-2.0 · NVIDIA/skills

Похожие скиллы

Всё по теме «ИИ и ML» →
gpu-server-management devops-skills Скилл ведёт агента по установке драйверов NVIDIA, CUDA и Docker с GPU, делит A100/H100 через MIG и настраивает мониторинг. CX Codex +1 331установок debug-openshell-cluster NVIDIA Скилл находит причины сбоев шлюза OpenShell, проблем с TLS и ошибок запуска песочниц в контейнерах и Kubernetes. CX Codex +1 474установок nemo-evaluator-sdk Orchestra Research Скилл запускает оценку языковых моделей на 100+ бенчмарках из 18+ харнессов: MMLU, HumanEval, GSM8K, safety и VLM. Пригодится, когда нужно сравнить модели воспроизводимо. CX Codex +1 943установок runpod-usage runpod Объясняет, как устроен Runpod: поды против Serverless, выбор GPU и VRAM, образы, хранилища и сеть. Пригодится, когда нужно решить, что запускать, до того как что-то запускать. CX Codex +1 12 500установок runpod-templates runpod Скилл находит официальные шаблоны Runpod Pod, подсказывает порты и автозапуск и чинит метаданные моделей в воркфлоу ComfyUI. CX Codex +1 10 100установок build-models replicate Помогает упаковать свою модель в контейнер Cog и запустить её локально. Пригодится, когда есть веса или чужой проект с HuggingFace и нужен predict.py. CX Codex +1 1 800установок

Из того же набора178

tao-train-mask-grounding-dino Скилл помогает обучать и запускать Mask Grounding DINO для сегментации объектов по текстовым запросам. Пригодится для обучения, оценки, экспорта, квантования и инференса модели TAO. CX Codex +1 1 600установок tao-train-bevfusion Скилл для обучения и запуска BEVFusion — 3D-детекция объектов по лидару и камерам. Пригодится, если вы работаете с моделью TAO BEVFusion. CX Codex +1 1 600установок tao-mine-aoi-images Запускает пайплайн DEFT для майнинга похожих дефектных кадров из пула кандидатов. Пригодится для пополнения обучающей выборки в задачах визуального контроля качества. CX Codex +1 1 600установок tao-train-ocdnet Скилл помогает работать с OCDNet для обнаружения текста произвольной ориентации на изображениях. Используйте его для обучения, оценки или запуска инференса модели. CX Codex +1 1 600установок tao-train-segformer Обучает и запускает SegFormer для семантической сегментации через TAO. Нужен для обучения, оценки, экспорта, квантования и инференса модели. CX Codex +1 1 600установок tao-train-visual-changenet Скилл для обучения, оценки и экспорта модели Visual ChangeNet из TAO Toolkit: сравнение пар изображений и поиск дефектов на платах. CX Codex +1 1 600установок tao-train-nvdinov2 Обучает трансформеры компьютерного зрения ViT методом самодистилляции без разметки через NVIDIA TAO. Пригодится для подготовки базовых моделей под задачи извлечения признаков. CX Codex +1 1 600установок tao-generate-referring-expressions Скилл строит выражения для привязки объектов к областям изображения по KITTI-разметке. Пригодится для подготовки аннотаций с координатами рамок и описаниями сцен. CX Codex +1 1 600установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой