Model Configuration#

Parameter

Type

Description

Default

type

string

CLIP model type. Only internvideo2-clip-l14 is supported: the video dataloader emits [B, T, C, H, W] and the InternVideo2-CLIP adapter is the only one that consumes 5D input. Image-only CLIP families (C-RADIO, SigLIP2, OpenCLIP) belong to the clip task.

internvideo2-clip-l14

freeze_vision_encoder

bool

When True, freeze vision encoder weights during training.

false

freeze_text_encoder

bool

When True, freeze text encoder weights during training.

false

image_size

int

Input image resolution for training transforms. Common values: 224 (InternVideo2-CLIP L14 / RADIO / OpenCLIP), 256 (SigLIP2-so400m), 384 (SigLIP2-g). Must be a multiple of the model’s patch size (typically 14 or 16).

224

init_logit_scale

float

Override for the initial logit scale (log-space). When null, TAO sets it from train.loss_type: 4.605170185988092 (the natural logarithm of 100) for internvideo2_vtc, 2.6592 for clip, and 2.3026 for siglip. Set manually only with caution, because incorrect values can destabilize training.

null

init_logit_bias

float

Override for the initial logit bias. When null, TAO sets it from train.loss_type: -10.0 for siglip and 0.0 for every other loss, including the default internvideo2_vtc. Set manually only with caution, because incorrect values can destabilize training.

null

canonicalize_text

bool

Lowercase the text and strip punctuation before tokenization. This field has no effect on the video_clip training, evaluation, or inference path, which never applies it. TAO records it in the exported *_config.yaml, and TAO Deploy does apply it when tokenizing queries, so leave it at false unless you need that deploy-side behavior.

false

pretrained_ckpt

string

Optional local .pth holding the COMPLETE InternVideo2-CLIP model state_dict. If set, it is loaded last and overrides all component weights (vision/text/clip_head). Must also be null for the all-null train-from-scratch configuration.

null

internvideo2clip_hf_id

string

HuggingFace repo id for InternVideo2-CLIP assets (provides the vision encoder and CLIP head). Resolved using the ambient HF cache (set HF_HOME). Suggested value: OpenGVLab/InternVideo2_distillation_models. Leave null together with vision_encoder, text_encoder, clip_head, and pretrained_ckpt (all null) to train from scratch / random initialization.

null

vision_encoder

string

Vision encoder source: a local file OR an HF repo id. If unset, resolved from internvideo2clip_hf_id (suggested: OpenGVLab/InternVideo2_distillation_models). Null with all other weight-source fields null results in train from scratch.

null

text_encoder

string

Text encoder (MobileCLIP) source: a local file OR an HF repo id. Required when pretrained_ckpt is not set (MobileCLIP is not in the IV2CLIP repo). Suggested: MobileCLIP mobileclip_blt.pt (local path or HF id). Leave null only for the all-null train-from-scratch configuration.

null

clip_head

string

CLIP alignment head source: a local file OR an HF repo id. If unset, resolved from internvideo2clip_hf_id (suggested: OpenGVLab/InternVideo2_distillation_models). Applied last and overwrites overlapping vision/text keys. Null with all other weight- source fields null results in train from scratch.

null

num_frames

int

Number of video frames for InternVideo2 video-text inputs.

8

use_flash_attn

bool

Enable upstream InternVideo2 FlashAttention in the vision encoder (use_flash_attn). Requires flash-attn in the env.

false

use_fused_rmsnorm

bool

Enable upstream InternVideo2 fused RMSNorm (use_fused_rmsnorm). Requires the flash-attn dropout_layer_norm CUDA extension.

false

use_fused_mlp

bool

Enable upstream InternVideo2 fused MLP (use_fused_mlp). Requires the flash-attn fused_dense_lib CUDA extension.

false

Video-Text Source Configuration#

Parameter

Type

Description

Default

metadata

union

List of video-text JSON/JSONL metadata file paths whose records are concatenated (each file must be a JSON array / JSONL). A single file may be given as a one-element list; a bare string path is still accepted for backward compatibility.

null

data_root

string

Root directory used to resolve relative/remapped video paths.

null

split

string

Optional split filter, such as train or test.

null

path_prefix_mapping

collection

Optional mapping from original path prefixes to local prefixes.

{}

caption_fields

list

Metadata fields used as caption candidates.

['caption']

caption_mode

categorical

Caption selection strategy. first: always use the first caption (captions[0]). random: sample one caption per epoch from the flat pool. all (train-only): explode each chunk into one entry per caption so every caption is trained each epoch. one_per_field (train-only): explode one entry per caption field, sampling one caption from within that field each epoch (equal weight per field). Exploded entries share the chunk’s idx (multi-positive); all/one_per_field require train.loss_type=internvideo2_vtc and are ignored for val/eval. Valid options: first, random, all, one_per_field.

first

idx_mode

categorical

How to build InternVideo2 VTC positive ids. Valid options: sample_id, video_id, category, field.

sample_id

idx_field

string

Metadata field used when idx_mode=``field``.

null

task_type

categorical

Dataset task type. classification groups samples by their category label (for example, Vad-R1 anomaly_type) for supervised-contrastive training; retrieval uses instance/video grouping. Governs how the dataset class derives the category and default idx grouping. Valid options: retrieval, classification.

retrieval

anomaly_only

bool

For Vad-R1 chunks, keep only anomaly chunks.

false

num_frames

int

Number of frames to sample from each video clip.

8

relevance_file

string

Optional path to an explicit-relevance eval-query file (for example, a frozen domain_test.json with a queries list of {query, chunk_id, slice, relevant_clip_ids}). When set on the val source, evaluation scores those text queries against this dataset as the shared gallery, per slice, using the per-query relevant_clip_ids. When null, evaluation uses the default idx-grouped retrieval.

null

Training Dataset Configuration#

Parameter

Type

Description

Default

batch_size

int

Training batch size per GPU.

16

num_workers

int

Number of data loading worker processes.

8

type

categorical

Dataset type. Only video_text (video-text retrieval metadata) is supported; the legacy image-text custom and wds types were removed. Valid options: video_text.

video_text

video_text

collection

Video-text configuration (used when type=``video_text``).

Video-Text Source Configuration

Validation Dataset Configuration#

Parameter

Type

Description

Default

batch_size

int

Batch size per GPU.

16

num_workers

int

Number of data loading worker processes.

8

type

categorical

Validation dataset type. Only video_text is supported; the legacy image-text custom type was removed. Valid options: video_text.

video_text

video_text

collection

Video-text validation configuration.

Video-Text Source Configuration

Inference Dataset Configuration#

Parameter

Type

Description

Default

batch_size

int

Batch size per GPU.

16

num_workers

int

Number of data loading worker processes.

8

type

categorical

Inference corpus type (video_text metadata). Valid options: video_text.

video_text

video_text

collection

Video-text corpus configuration for inference.

Video-Text Source Configuration

Metrics Configuration#

Parameter

Type

Description

Default

mode

categorical

Evaluation metric mode. retrieval reports N-to-N multi-relevant mAP / recall@k / hit@k; classification reports category-level MAP / MRR / macro P-R-F1 / top-K (cosmos-embed1 parity). Valid options: retrieval, classification.

retrieval

exclude_categories

list

Category names excluded from classification MAP/MRR and macro averages (case-insensitive).

['Normal', 'Abnormal']

Augmentation Configuration#

Parameter

Type

Description

Default

scale

list

Scale range [min, max] for random resized crop. Set to [1.0, 1.0] to disable.

[0.4, 1.0]

color_jitter

list

Color jitter [prob, brightness, contrast, saturation, hue]. Set to [] to disable.

[0.8, 0.32, 0.32, 0.32, 0.08]

grayscale

float

Probability of grayscale conversion. Set to 0.0 to disable.

0.2

Dataset Configuration#

Parameter

Type

Description

Default

train

collection

Training dataset configuration.

Training Dataset Configuration

val

collection

Validation dataset configuration.

Validation Dataset Configuration

metrics

collection

Evaluation metric configuration (metric mode, excluded categories).

Metrics Configuration

inference

collection

Inference corpus configuration (gallery to embed/search).

Inference Dataset Configuration

augmentation

collection

Data augmentation configuration.

Augmentation Configuration

pin_memory

bool

Pin memory in DataLoader for faster GPU transfer.

true

seed

int

Random seed for data loading and shuffling.

42

Training Configuration#

Parameter

Type

Description

Default

num_gpus

int

The number of GPUs to run the train job.

1

gpu_ids

list

List of GPU IDs to run the training on. The length of this list must be equal to the number of gpus in train.num_gpus.

[0]

num_nodes

int

Number of nodes to run the training on. If > 1, then multi-node is enabled.

1

seed

int

The seed for the initializer in PyTorch. If < 0, disable fixed seed.

1234

num_epochs

int

Number of epochs to run the training.

10

checkpoint_interval

int

The interval (in epochs) at which a checkpoint will be saved. Helps resume training.

1

checkpoint_interval_unit

categorical

The unit of the checkpoint interval. Valid options: epoch, step.

epoch

validation_interval

int

The interval (in epochs) at which a evaluation will be triggered on the validation dataset.

1

resume_training_checkpoint_path

string

Path to the checkpoint to resume training from.

null

optim

collection

Optimizer configuration with per-tower learning rates.

Optimizer Configuration

loss_type

categorical

Contrastive loss function: siglip (sigmoid), clip (softmax), or internvideo2_vtc (InternVideo2 video-text contrastive loss with idx positives). Valid options: siglip, clip, internvideo2_vtc.

internvideo2_vtc

precision

categorical

Training precision: fp16 (mixed), fp32 (full), or bf16 (bfloat16). Valid options: fp16, fp32, bf16.

fp16

grad_clip_norm

float

Maximum gradient norm for clipping. Set to None to disable.

null

grad_checkpointing

bool

Enable gradient checkpointing to reduce memory at cost of speed.

false

distributed_strategy

categorical

Distributed training strategy: ddp or fsdp (fully sharded). Valid options: ddp, fsdp.

ddp

pretrained_model_path

string

Path to pretrained model checkpoint for fine-tuning.

null

val_check_interval

int

Run validation every N training steps. If None, validates at end of epoch.

null

Optimizer Configuration#

Parameter

Type

Description

Default

optimizer_type

categorical

Optimizer type: adamw (AdamW) or lamb (LAMB). Valid options: adamw, lamb.

adamw

vision_lr

float

Learning rate for the vision encoder.

0.0001

text_lr

float

Learning rate for the text encoder.

0.0001

weight_decay

float

Weight decay (L2 regularization) coefficient.

0.0001

betas

list

Adam/LAMB beta parameters [beta1, beta2] for momentum.

[0.9, 0.95]

eps

float

Epsilon for numerical stability.

1e-06

warmup_steps

int

Number of linear warmup steps for learning rate.

100

scheduler

categorical

LR schedule after warmup: cosine (cosine decay to 0), constant (hold at base LR), linear (linear decay to 0). Valid options: cosine, constant, linear.

cosine

PEFT Configuration#

Parameter

Type

Description

Default

enabled

bool

Enable PEFT mode. When False, training uses standard full fine-tuning (the standard behavior).

false

method

categorical

PEFT method. Currently only lora is supported. Valid options: lora.

lora

vision

collection

LoRA configuration for the vision encoder (InternVideo2: target_modules qkv, proj).

LoRA Tower Configuration

text

collection

LoRA configuration for the text encoder (MobileCLIP: target_modules qkv_proj, out_proj).

LoRA Tower Configuration

LoRA Tower Configuration#

Parameter

Type

Description

Default

enabled

bool

Enable LoRA adaptation for this encoder tower.

false

target_modules

list

Attention-projection leaf module names to wrap with LoRA within each adapted block. Defaults are for the InternVideo2-CLIP vision tower (fused qkv + proj); the MobileCLIP text tower uses qkv_proj + out_proj (set on the peft.text default). Matching is by the leaf module name.

['qkv', 'proj']

num_last_blocks

int

Number of final transformer blocks to adapt. 0 means adapt all blocks.

3

rank

int

LoRA rank (low-rank dimension).

8

alpha

int

LoRA alpha scaling factor. Effective scale = alpha / rank.

16

dropout

float

Dropout applied to LoRA input.

0.05

Regularization Configuration#

Parameter

Type

Description

Default

enabled

bool

Enable preservation regularization. When False, only the contrastive loss is used (the standard behavior).

false

embedding_mse_weight

float

Weight for MSE loss between student and teacher embeddings.

0.05

cosine_weight

float

Weight for cosine preservation loss between student and teacher embeddings.

0.05

similarity_weight

float

Weight for similarity matrix preservation loss (MSE between student and teacher image-text similarity matrices).

0.1

Evaluation Configuration#

Parameter

Type

Description

Default

checkpoint

string

Required path to a trained model checkpoint (.ckpt or .pth) for evaluation or inference.

Required

results_dir

string

Directory to save inference/evaluation results.

null

num_gpus

int

Number of GPUs to use.

1

gpu_ids

list

List of GPU device IDs to use.

[0]

Inference Configuration#

Parameter

Type

Description

Default

checkpoint

string

Required path to a trained model checkpoint (.ckpt or .pth) for evaluation or inference.

Required

results_dir

string

Directory to save inference/evaluation results.

null

num_gpus

int

Number of GPUs to use.

1

gpu_ids

list

List of GPU device IDs to use.

[0]

batch_size

int

Batch size per GPU.

16

num_workers

int

Number of data loading worker processes.

8

video_embeddings_file

string

Explicit path for the video embeddings .h5. If it exists it is reused (generation skipped); if set but missing it is generated there. Defaults to <results_dir>/video_embeddings.h5.

null

text_embeddings_file

string

Explicit path for the text embeddings .h5 (reusable query/label cache). Reused if present, generated if missing. Defaults to <results_dir>/text_embeddings.h5.

null

overwrite_embeddings

bool

Regenerate embeddings even if a cached file is present.

false

search

collection

Search / retrieval ranking over the embeddings.

Search Configuration

mode

categorical

embeddings extracts embeddings; retrieval ranks the corpus against the queries and writes top-k matches (see the search sub- config). Valid options: embeddings, retrieval.

embeddings

query

collection

Inline ad-hoc text/video queries.

Query Configuration

Search Configuration#

Parameter

Type

Description

Default

search_metric

categorical

Ranking metric: cosine (cosine similarity, higher is closer) or knn (Euclidean/L2 distance, smaller is closer). Valid options: cosine, knn.

cosine

normalize

bool

L2-normalize embeddings before scoring. On normalized vectors cosine and knn give the same ranking.

true

top_k

int

Number of video clips returned per text query.

10

Query Configuration#

Parameter

Type

Description

Default

input_texts

list

Inline text queries to embed / search with.

[]

input_videos

list

Inline video file paths to embed / search with.

[]

text_file

string

Optional file with one text prompt per line (convenience for large query lists; merged with input_texts).

null

num_frames

int

Frames sampled per inline video query.

8

Export Configuration#

Parameter

Type

Description

Default

checkpoint

string

Required path to a trained TAO model checkpoint (.ckpt or .pth).

Required

onnx_file

string

Output ONNX file path (without extension for separate encoder_type).

null

encoder_type

categorical

Export mode: combined (single ONNX with both encoders), separate (two ONNX files: vision and text). Valid options: combined, separate.

combined

opset_version

int

ONNX opset version for export.

23

batch_size

int

ONNX batch mode: -1 exports a symbolic dynamic batch; a positive value exports a fixed batch. The internal dynamic tracing sample does not set a runtime maximum.

-1

input_height

int

Input image height for vision encoder export.

224

input_width

int

Input image width for vision encoder export.

224

gpu_id

int

GPU device ID to use for export.

0

on_cpu

bool

When True, export on CPU instead of GPU.

false

input_channel

int

Number of channels in the input image.

3

verbose

bool

Enable verbose ONNX export logging.

false