tao-finetune-clip
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCLIP
CLIP
Contrastive Language-Image Pre-training model for zero-shot and fine-tuned image classification, image-text retrieval, and embedding extraction. Fine-tuning adapts CLIP's shared image-text embedding space to domain-specific image-caption data.
No default NGC pretrained checkpoint is required. When , , , or is unset, TAO loads pretrained weights from HuggingFace for SigLIP2/OpenCLIP variants or for Radio-CLIP, so first use needs network access or a local mirror.
train.pretrained_model_pathevaluate.checkpointinference.checkpointexport.checkpointtorch.hubSupported actions: , , , , .
trainevaluateinferenceexportgen_trt_engineCLIP是用于零样本与微调图像分类、图文检索及嵌入提取的对比式语言-图像预训练模型。微调可让CLIP共享的图文嵌入空间适配特定领域的图像-标题数据。
无需默认NGC预训练检查点。当、、或未设置时,TAO会从HuggingFace加载SigLIP2/OpenCLIP变体的预训练权重,或从加载Radio-CLIP的预训练权重,因此首次使用需要网络访问或本地镜像。
train.pretrained_model_pathevaluate.checkpointinference.checkpointexport.checkpointtorch.hub支持的操作:、、、、。
trainevaluateinferenceexportgen_trt_engineTrain 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。处理任何训练阶段请求前,需读取,并通过显式值或用户工作流请求解析运行覆盖项。将“关闭AutoML”“禁用AutoML”“无HPO”或“普通训练”这类表述视为本次运行的;否则默认设为。当、,且和已打包时,默认将训练操作通过路由,并使用该模型的。保留数据集、配置、输出目录、GPU/平台设置、父检查点及的工作流/应用覆盖项。仅当或打包的训练配置文件/模板缺失时,才使用直接模型训练;若配置文件缺失,需报告AutoML已启用但当前模型无法运行,需生成配置文件后方可使用。
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_policyInstructions
使用说明
Use this skill for NVIDIA TAO CLIP jobs: training, evaluation, embedding inference, ONNX export, and TensorRT engine generation. Start by identifying the requested action, then load only the referenced files needed for that action: for default parameters, for action/data-source wiring, for full spec shape, and for SDK metadata.
defaults.jsonconfig.jsonreferences/spec_template.yamlreferences/model_info.yamlFor dataset-backed actions, collect the required image, caption, list, or prompt files from the user and place the resolved paths in . For and , infer parent artifacts from the upstream job when available; otherwise require explicit checkpoint, ONNX, or engine paths. Run , TensorRT , and TensorRT in the TAO Deploy image.
spec_overridesexportgen_trt_enginegen_trt_engineevaluateinferenceFor 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-clip.mdreferences/spec_template_deploy_*.yaml本技能适用于NVIDIA TAO CLIP任务:训练、评估、嵌入推理、ONNX导出及TensorRT引擎生成。首先确定所需操作,然后仅加载该操作所需的参考文件:(默认参数)、(操作/数据源关联)、(完整配置结构)及(SDK元数据)。
defaults.jsonconfig.jsonreferences/spec_template.yamlreferences/model_info.yaml对于基于数据集的操作,需从用户处收集所需的图像、标题、列表或提示文件,并将解析后的路径放入。对于和操作,若上游任务存在则推断父工件;否则需要显式提供检查点、ONNX或引擎路径。、TensorRT 及TensorRT 需在TAO Deploy镜像中运行。
spec_overridesexportgen_trt_enginegen_trt_engineevaluateinference对于TAO Deploy TensorRT操作(、TensorRT 及TensorRT ),需先阅读。部署配置模板存放在本技能的文件夹中,前缀为。
gen_trt_engineevaluateinferencereferences/tao-deploy-clip.mdreferences/spec_template_deploy_*.yamlTraining Requirements
训练要求
- Dataset type: image_text
- Formats: custom image/caption folders or WebDataset shards
- Monitoring metric: val/t2i_mAP
- 数据集类型: image_text
- 格式: 自定义图像/标题文件夹或WebDataset分片
- 监控指标: val/t2i_mAP
Supported Models
支持的模型
- SigLIP2: (default),
siglip2-so400m-patch16-256,siglip2-so400m-patch14-224,siglip2-so400m-patch14-384,siglip2-so400m-patch16-384,siglip2-so400m-patch16-512siglip2-so400m-patch16-naflex - Radio-CLIP: ,
c-radio_v3-b,c-radio_v3-l,c-radio_v3-hc-radio_v3-g - OpenCLIP / NV-CLIP: ,
ViT-L-14-SigLIP-CLIPA-224,ViT-L-14-SigLIP-CLIPA-336,ViT-H-14-SigLIP-CLIPA-224,ViT-H-14-SigLIP-CLIPA-336ViT-H-14-SigLIP-CLIPA-574
Radio-CLIP requires to be set to or .
model.adaptor_namesiglipclip- SigLIP2: (默认)、
siglip2-so400m-patch16-256、siglip2-so400m-patch14-224、siglip2-so400m-patch14-384、siglip2-so400m-patch16-384、siglip2-so400m-patch16-512siglip2-so400m-patch16-naflex - Radio-CLIP: 、
c-radio_v3-b、c-radio_v3-l、c-radio_v3-hc-radio_v3-g - OpenCLIP / NV-CLIP: 、
ViT-L-14-SigLIP-CLIPA-224、ViT-L-14-SigLIP-CLIPA-336、ViT-H-14-SigLIP-CLIPA-224、ViT-H-14-SigLIP-CLIPA-336ViT-H-14-SigLIP-CLIPA-574
Radio-CLIP需设置为或。
model.adaptor_namesiglipclipPer-Action Dataset Requirements
各操作的数据集要求
| Action | Spec Key | Source | Files | List? |
|---|---|---|---|---|
| train | dataset.train.datasets | train_datasets | image_dir: images.tar.gz, image_list_file: image_list.txt, caption_dir: captions.tar.gz | Yes |
| train | dataset.train.wds.root_dir | train_wds_dataset | root directory containing | No |
| train | dataset.train.wds.shard_list_file | train_wds_dataset | shards.txt listing shard paths | No |
| train | dataset.val.datasets | eval_dataset | image_dir: images.tar.gz, image_list_file: image_list.txt, caption_dir: captions.tar.gz | Yes |
| evaluate | dataset.val.datasets | eval_dataset | image_dir: images.tar.gz, image_list_file: image_list.txt, caption_dir: captions.tar.gz | Yes |
| inference | inference.datasets | inference_dataset | image_dir: images.tar.gz | Yes |
| inference | inference.text_file | inference_dataset | prompts.txt | No |
| export | export.checkpoint | parent train job or explicit checkpoint | checkpoint .pth, optional for pretrained export | No |
| gen_trt_engine | gen_trt_engine.onnx_file | parent export job or explicit ONNX | clip_model.onnx | No |
For custom training, set and provide entries. Image and caption files must share the same base name. defaults to , and is optional.
dataset.train.type: customdataset.train.datasetscaption_file_suffix.txtimage_list_fileFor WDS training, set and provide at least one of or . is scanned recursively for shards. is a text file with one shard path per line; relative lines resolve under the list-file directory unless is also supplied, in which case they resolve under . Validation/evaluation data remains custom format via .
dataset.train.type: wdsdataset.train.wds.root_dirdataset.train.wds.shard_list_fileroot_dir.tarshard_list_fileroot_dirroot_dirdataset.val.datasets| 操作 | 配置键 | 来源 | 文件 | 是否需要列表? |
|---|---|---|---|---|
| train | dataset.train.datasets | train_datasets | image_dir: images.tar.gz, image_list_file: image_list.txt, caption_dir: captions.tar.gz | 是 |
| train | dataset.train.wds.root_dir | train_wds_dataset | 包含 | 否 |
| train | dataset.train.wds.shard_list_file | train_wds_dataset | 列出分片路径的shards.txt | 否 |
| train | dataset.val.datasets | eval_dataset | image_dir: images.tar.gz, image_list_file: image_list.txt, caption_dir: captions.tar.gz | 是 |
| evaluate | dataset.val.datasets | eval_dataset | image_dir: images.tar.gz, image_list_file: image_list.txt, caption_dir: captions.tar.gz | 是 |
| inference | inference.datasets | inference_dataset | image_dir: images.tar.gz | 是 |
| inference | inference.text_file | inference_dataset | prompts.txt | 否 |
| export | export.checkpoint | 父训练任务或显式检查点 | 检查点.pth,预训练导出可选 | 否 |
| gen_trt_engine | gen_trt_engine.onnx_file | 父导出任务或显式ONNX文件 | clip_model.onnx | 否 |
自定义训练需设置并提供条目。图像和标题文件必须共享相同的基础名称。默认为,为可选。
dataset.train.type: customdataset.train.datasetscaption_file_suffix.txtimage_list_fileWDS训练需设置并至少提供或中的一个。会递归扫描分片。是每行一个分片路径的文本文件;相对路径会在列表文件目录下解析,若同时提供则在下解析。验证/评估数据仍通过使用自定义格式。
dataset.train.type: wdsdataset.train.wds.root_dirdataset.train.wds.shard_list_fileroot_dir.tarshard_list_fileroot_dirroot_dirdataset.val.datasetsTypical Spec Overrides
典型配置覆盖项
Data source overrides are mandatory for dataset-backed actions. Construct paths from the Per-Action Dataset Requirements table and include them in . For inference, provide at least one of or .
spec_overridesinference.datasetsinference.text_filepython
S3_TRAIN = "s3://bucket/data/train"
S3_WDS = "s3://bucket/data/wds"
S3_EVAL = "s3://bucket/data/eval"
S3_INFER = "s3://bucket/data/infer"train, custom dataset:
python
{
"train.num_epochs": 10,
"dataset.train.type": "custom",
"dataset.train.datasets": [{"image_dir": f"{S3_TRAIN}/images.tar.gz", "image_list_file": f"{S3_TRAIN}/image_list.txt", "caption_dir": f"{S3_TRAIN}/captions.tar.gz"}],
"dataset.val.datasets": [{"image_dir": f"{S3_EVAL}/images.tar.gz", "image_list_file": f"{S3_EVAL}/image_list.txt", "caption_dir": f"{S3_EVAL}/captions.tar.gz"}],
}train, WDS dataset:
python
{
"train.num_epochs": 10,
"dataset.train.type": "wds",
"dataset.train.wds.root_dir": f"{S3_WDS}",
"dataset.train.wds.shard_list_file": f"{S3_WDS}/shards.txt",
"dataset.train.wds.samples_per_shard": 10000,
"dataset.val.datasets": [{"image_dir": f"{S3_EVAL}/images.tar.gz", "image_list_file": f"{S3_EVAL}/image_list.txt", "caption_dir": f"{S3_EVAL}/captions.tar.gz"}],
}evaluate:
python
{
"dataset.val.datasets": [{"image_dir": f"{S3_EVAL}/images.tar.gz", "image_list_file": f"{S3_EVAL}/image_list.txt", "caption_dir": f"{S3_EVAL}/captions.tar.gz"}],
}Leave unset for zero-shot evaluation with pretrained weights. Set instead of for TensorRT evaluation.
evaluate.checkpointevaluate.trt_engineevaluate.checkpointinference:
python
{
"inference.datasets": [{"image_dir": f"{S3_INFER}/images.tar.gz"}],
"inference.text_file": f"{S3_INFER}/prompts.txt",
}Inference writes and/or under . The saved embeddings are L2-normalized.
image_embeddings.h5text_embeddings.h5results_direxport:
python
{
"export.onnx_file": "${results_dir}/export/clip_model.onnx",
"export.encoder_type": "combined",
"export.batch_size": -1,
}Set when deployment should use independent vision and text encoders. Separate export writes and variants derived from the base .
export.encoder_type: separate_vision.onnx_text.onnxexport.onnx_filegen_trt_engine:
python
{
"gen_trt_engine.onnx_file": "${results_dir}/export/clip_model.onnx",
"gen_trt_engine.trt_engine": "${results_dir}/deploy/clip_model.engine",
"gen_trt_engine.batch_size": -1,
"gen_trt_engine.tensorrt.data_type": "fp16",
"gen_trt_engine.tensorrt.min_batch_size": 1,
"gen_trt_engine.tensorrt.opt_batch_size": 1,
"gen_trt_engine.tensorrt.max_batch_size": 16,
}基于数据集的操作必须覆盖数据源。根据“各操作的数据集要求”表格构造路径并放入。推理操作需至少提供或中的一个。
spec_overridesinference.datasetsinference.text_filepython
S3_TRAIN = "s3://bucket/data/train"
S3_WDS = "s3://bucket/data/wds"
S3_EVAL = "s3://bucket/data/eval"
S3_INFER = "s3://bucket/data/infer"训练(自定义数据集):
python
{
"train.num_epochs": 10,
"dataset.train.type": "custom",
"dataset.train.datasets": [{"image_dir": f"{S3_TRAIN}/images.tar.gz", "image_list_file": f"{S3_TRAIN}/image_list.txt", "caption_dir": f"{S3_TRAIN}/captions.tar.gz"}],
"dataset.val.datasets": [{"image_dir": f"{S3_EVAL}/images.tar.gz", "image_list_file": f"{S3_EVAL}/image_list.txt", "caption_dir": f"{S3_EVAL}/captions.tar.gz"}],
}训练(WDS数据集):
python
{
"train.num_epochs": 10,
"dataset.train.type": "wds",
"dataset.train.wds.root_dir": f"{S3_WDS}",
"dataset.train.wds.shard_list_file": f"{S3_WDS}/shards.txt",
"dataset.train.wds.samples_per_shard": 10000,
"dataset.val.datasets": [{"image_dir": f"{S3_EVAL}/images.tar.gz", "image_list_file": f"{S3_EVAL}/image_list.txt", "caption_dir": f"{S3_EVAL}/captions.tar.gz"}],
}评估:
python
{
"dataset.val.datasets": [{"image_dir": f"{S3_EVAL}/images.tar.gz", "image_list_file": f"{S3_EVAL}/image_list.txt", "caption_dir": f"{S3_EVAL}/captions.tar.gz"}],
}若使用预训练权重进行零样本评估,无需设置。若使用TensorRT评估,需设置而非。
evaluate.checkpointevaluate.trt_engineevaluate.checkpoint推理:
python
{
"inference.datasets": [{"image_dir": f"{S3_INFER}/images.tar.gz"}],
"inference.text_file": f"{S3_INFER}/prompts.txt",
}推理会在下生成和/或。保存的嵌入经过L2归一化处理。
results_dirimage_embeddings.h5text_embeddings.h5导出:
python
{
"export.onnx_file": "${results_dir}/export/clip_model.onnx",
"export.encoder_type": "combined",
"export.batch_size": -1,
}若部署需使用独立的视觉和文本编码器,设置。分离导出会基于基础生成和变体。
export.encoder_type: separateexport.onnx_file_vision.onnx_text.onnx生成TensorRT引擎:
python
{
"gen_trt_engine.onnx_file": "${results_dir}/export/clip_model.onnx",
"gen_trt_engine.trt_engine": "${results_dir}/deploy/clip_model.engine",
"gen_trt_engine.batch_size": -1,
"gen_trt_engine.tensorrt.data_type": "fp16",
"gen_trt_engine.tensorrt.min_batch_size": 1,
"gen_trt_engine.tensorrt.opt_batch_size": 1,
"gen_trt_engine.tensorrt.max_batch_size": 16,
}Eval Dataset
评估数据集
Optional for training. If provided, validation metrics are computed at validation intervals. Required for .
evaluate训练时可选。若提供,会在验证间隔计算验证指标。操作必须提供。
evaluateDeploy Workflow
部署工作流
The skill exposes as the deploy action. In generated SDK runners, use and run it in the TAO Deploy image, not the PyTorch training image. The in-container command is ; direct TAO Launcher usage spells the same action as .
gen_trt_enginemodel_info["actions"]["gen_trt_engine"]clip gen_trt_engine -e {config_path}tao deploy clip gen_trt_engine -e /path/to/spec.yamlTAO Deploy supports both combined and separate encoder formats. For separate encoders, pass the base path without or to and ; TAO detects or writes the suffixed vision/text files.
_vision_textgen_trt_engine.onnx_filegen_trt_engine.trt_engineUse for TensorRT evaluation and for TensorRT embedding extraction. These TensorRT paths also run in the TAO Deploy image. Direct TAO Launcher usage spells these as and .
evaluate.trt_engineinference.trt_enginetao deploy clip evaluatetao deploy clip inferenceFull TAO Deploy reference: tao-deploy-clip.
本技能将作为部署操作。在生成的SDK运行器中,使用并在TAO Deploy镜像(而非PyTorch训练镜像)中运行。容器内命令为;直接使用TAO Launcher的命令为。
gen_trt_enginemodel_info["actions"]["gen_trt_engine"]clip gen_trt_engine -e {config_path}tao deploy clip gen_trt_engine -e /path/to/spec.yamlTAO Deploy支持组合式和分离式编码器格式。对于分离式编码器,将不带或的基础路径传入和;TAO会检测或生成带后缀的视觉/文本文件。
_vision_textgen_trt_engine.onnx_filegen_trt_engine.trt_engine使用进行TensorRT评估,使用进行TensorRT嵌入提取。这些TensorRT操作同样在TAO Deploy镜像中运行。直接使用TAO Launcher的命令为和。
evaluate.trt_engineinference.trt_enginetao deploy clip evaluatetao deploy clip inference完整TAO Deploy参考:tao-deploy-clip。
Important Parameters
重要参数
- model.type: Backbone family and resolution. Use fixed-resolution SigLIP2/OpenCLIP variants for deployment.
- model.adaptor_name: Required for Radio-CLIP. Set to or
siglip.clip - model.image_size: Training transform image resolution. Keep it aligned with the selected fixed-resolution backbone.
- train.num_epochs: CLIP fine-tuning often converges quickly. Start with 10-20 epochs for domain adaptation, then increase only if validation loss is still improving.
- train.optim.vision_lr / train.optim.text_lr: Learning rates for the two encoders. CLIP is sensitive to high learning rates; reduce both if loss is unstable.
- model.freeze_vision_encoder / model.freeze_text_encoder: Defaults are false. Freezing one encoder can help when the dataset is small or only one modality needs adaptation.
- train.loss_type: is recommended for SigLIP2 and Radio-CLIP. Use
siglipfor CLIP-style softmax loss.clip - export.encoder_type: exports one ONNX graph.
combinedexports independent vision and text graphs.separate - gen_trt_engine.tensorrt.data_type: TensorRT deployment supports and
fp16.fp32
- model.type: 骨干网络系列及分辨率。部署时使用固定分辨率的SigLIP2/OpenCLIP变体。
- model.adaptor_name: Radio-CLIP必填。设置为或
siglip。clip - model.image_size: 训练变换的图像分辨率。需与所选固定分辨率骨干网络保持一致。
- train.num_epochs: CLIP微调通常收敛较快。领域适配先从10-20个epoch开始,仅当验证损失仍在改善时再增加。
- train.optim.vision_lr / train.optim.text_lr: 两个编码器的学习率。CLIP对高学习率敏感;若损失不稳定,需降低两者的学习率。
- model.freeze_vision_encoder / model.freeze_text_encoder: 默认值为false。当数据集较小时或仅需适配一种模态时,冻结一个编码器会有所帮助。
- train.loss_type: SigLIP2和Radio-CLIP推荐使用。CLIP风格的softmax损失使用
siglip。clip - export.encoder_type: 导出单个ONNX图。
combined导出独立的视觉和文本图。separate - gen_trt_engine.tensorrt.data_type: TensorRT部署支持和
fp16。fp32
Hardware
硬件要求
Single-GPU training works for small datasets. Use 4+ GPUs for datasets with more than 100k images or large backbones. Use 16GB+ VRAM per GPU for small/fixed-resolution runs and larger GPUs for Radio-CLIP or high-resolution OpenCLIP variants.
单GPU适用于小型数据集训练。数据集超过10万张图像或使用大型骨干网络时,需使用4个及以上GPU。小型/固定分辨率运行需每GPU至少16GB显存,Radio-CLIP或高分辨率OpenCLIP变体需使用更大显存的GPU。
Error Patterns
错误模式
CUDA out of memory: Reduce , , or the TensorRT opt/max batch sizes. For export/deploy, check and against the selected fixed-resolution backbone.
dataset.train.batch_sizedataset.val.batch_sizeexport.input_heightexport.input_widthNaN loss: Learning rate is too high for fine-tuning. Reduce and , increase , and verify that captions are valid non-empty text.
train.optim.vision_lrtrain.optim.text_lrtrain.optim.warmup_stepsZero retrieval or classification quality: Check that captions and prompts match the target label vocabulary. CLIP compares image and text embeddings, so prompt wording matters.
Dataset size smaller than total batch size: The total batch size is . If the dataset, especially validation, has fewer samples than this, reduce or .
batch_size * num_gpusdataset.val.batch_sizedataset.train.batch_sizeRadio-CLIP config validation error: Set explicitly to or .
model.adaptor_namesiglipclipNaflex export failure: is training-only in the current TAO docs and cannot be exported to ONNX or TensorRT. Use a fixed-resolution variant such as .
siglip2-so400m-patch16-naflexsiglip2-so400m-patch16-384ONNX external data missing: Models larger than 2 GB export an ONNX file plus an external data file. Keep both files in the same directory and do not rename the external data file before .
gen_trt_engineTensorRT shape mismatch: When using dynamic batch export, provide min/opt/max shape profiles for every input. Text sequence length must match the tokenizer length, commonly 77 for CLIP tokenizers and 64 for SigLIP2 tokenizers.
attention_mask warning: is currently accepted by exported graphs for compatibility, but TAO ignores its values and may remove it in a future release. Do not build new direct-ONNX inference code that depends on mask values.
attention_maskError merging spec.yaml with schema: A Hydra/OmegaConf config validation error. Common causes are putting or at the spec root instead of under , or mixing up training image size () with export dimensions ( and ).
num_epochsnum_gpustrain.*model.image_sizeexport.input_heightexport.input_widthCUDA内存不足: 减小、或TensorRT的最优/最大批量大小。导出/部署时,检查和是否与所选固定分辨率骨干网络匹配。
dataset.train.batch_sizedataset.val.batch_sizeexport.input_heightexport.input_width损失为NaN: 微调学习率过高。降低和,增加,并验证标题为有效的非空文本。
train.optim.vision_lrtrain.optim.text_lrtrain.optim.warmup_steps检索或分类质量为零: 检查标题和提示是否匹配目标标签词汇表。CLIP会比较图像和文本嵌入,因此提示措辞至关重要。
数据集大小小于总批量大小: 总批量大小为。若数据集(尤其是验证集)样本数小于该值,需减小或。
batch_size * num_gpusdataset.val.batch_sizedataset.train.batch_sizeRadio-CLIP配置验证错误: 需显式设置为或。
model.adaptor_namesiglipclipNaflex导出失败: 当前TAO文档中仅支持训练,无法导出到ONNX或TensorRT。请使用固定分辨率变体,如。
siglip2-so400m-patch16-naflexsiglip2-so400m-patch16-384ONNX外部数据缺失: 大于2GB的模型会导出一个ONNX文件加一个外部数据文件。需将两个文件放在同一目录下,且在前不要重命名外部数据文件。
gen_trt_engineTensorRT形状不匹配: 使用动态批量导出时,需为每个输入提供最小/最优/最大形状配置文件。文本序列长度必须与分词器长度匹配,CLIP分词器通常为77,SigLIP2分词器通常为64。
attention_mask警告: 导出的图目前为兼容性接受,但TAO会忽略其值,未来版本可能移除该参数。请勿构建依赖掩码值的新直接ONNX推理代码。
attention_maskspec.yaml与配置结构合并错误: Hydra/OmegaConf配置验证错误。常见原因是将或放在配置根目录而非下,或混淆训练图像大小()与导出维度(和)。
num_epochsnum_gpustrain.*model.image_sizeexport.input_heightexport.input_widthSpec Param / Parent Model Inference
配置参数/父模型推理
Model-specific inference mappings belong in this MD file, not in . Generated runners should read this section and apply the mappings with SDK helpers before . This mirrors the old microservices flow.
config.jsoncreate_job()infer_params.pyInference mappings from TAO Core :
clip.config.json| Action | Spec Field | Inference Function | Meaning |
|---|---|---|---|
| evaluate | | | encryption key |
| evaluate | | | model file inferred from the parent job results folder |
| evaluate | | | model file inferred from the parent job results folder |
| evaluate | | | current job results directory |
| export | | | encryption key |
| export | | | model file inferred from the parent job results folder |
| export | | | output ONNX path |
| export | | | current job results directory |
| gen_trt_engine | | | encryption key |
| gen_trt_engine | | | model file inferred from the parent job results folder |
| gen_trt_engine | | | output TensorRT engine path |
| gen_trt_engine | | | current job results directory |
| inference | | | encryption key |
| inference | | | model file inferred from the parent job results folder |
| inference | | | model file inferred from the parent job results folder |
| inference | | | current job results directory |
| train | | | encryption key |
| train | | | current job results directory |
| train | | | PTM when no resume checkpoint exists |
| train | | | model file inferred from the current job results folder |
For or , pass the upstream train/export/AutoML child job id as . 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 and do not patch generated runner scripts to guess checkpoint paths.
parent_modelparent_model_folderparent_job_idconfig.json模型特定的推理映射应放在本MD文件中,而非。生成的运行器应读取本节内容,并在前使用SDK助手应用映射。这与旧微服务的流程一致。
config.jsoncreate_job()infer_params.pyTAO Core 中的推理映射:
clip.config.json| 操作 | 配置字段 | 推理函数 | 含义 |
|---|---|---|---|
| evaluate | | | 加密密钥 |
| evaluate | | | 从父任务结果文件夹推断的模型文件 |
| evaluate | | | 从父任务结果文件夹推断的模型文件 |
| evaluate | | | 当前任务结果目录 |
| export | | | 加密密钥 |
| export | | | 从父任务结果文件夹推断的模型文件 |
| export | | | 输出ONNX路径 |
| export | | | 当前任务结果目录 |
| gen_trt_engine | | | 加密密钥 |
| gen_trt_engine | | | 从父任务结果文件夹推断的模型文件 |
| gen_trt_engine | | | 输出TensorRT引擎路径 |
| gen_trt_engine | | | 当前任务结果目录 |
| inference | | | 加密密钥 |
| inference | | | 从父任务结果文件夹推断的模型文件 |
| inference | | | 从父任务结果文件夹推断的模型文件 |
| inference | | | 当前任务结果目录 |
| train | | | 加密密钥 |
| train | | | 当前任务结果目录 |
| train | | | 无恢复检查点时的预训练模型 |
| train | | | 从当前任务结果文件夹推断的模型文件 |
对于或,传入上游训练/导出/AutoML子任务ID作为。SDK会列出父结果文件夹,过滤检查点工件,并返回所选模型文件或文件夹。请勿将这些映射添加回,也不要修改生成的运行器脚本以猜测检查点路径。
parent_modelparent_model_folderparent_job_idconfig.json