Grounding DINO
Grounding DINO 期望用于训练文件的图像目录采用 ODVG 格式的 JSONL 文件,而验证文件则采用 COCO 格式 的 JSON 注释文件。
与 TAO 中的其他目标检测网络不同,Grounding DINO 的 COCO JSON 文件中的 category_id
应从 0 开始,并且每个类别 ID 必须是连续的。这意味着类别范围可以从 0 到 num_classes - 1
。由于原始 COCO 注释不具有连续的类别 ID,请参阅 TAO Data Service tao dataset annotations convert
。
Grounding DINO 的训练实验规范文件包括 model
、train
和 dataset
参数。以下是使用 swin_tiny_224_1k
主干网络在 COCO 数据集上微调 Grounding DINO 模型的示例规范文件
dataset:
train_data_sources:
- image_dir: /path/to/coco/train2017/
json_file: /path/to/coco/annotations/instances_train2017.jsonl # odvg format
label_map: /path/to/coco/annotations/instances_train2017_labelmap.json
val_data_sources:
- image_dir: /path/to/coco/val2017/
json_file: /path/to/coco/annotations/instances_val2017_contiguous.json # category ids need to be contiguous
max_labels: 80 # Max number of postive + negative labels passed to the text encoder
batch_size: 4
workers: 8
dataset_type: serialized # To reduce the system memory usage
augmentation:
scales: [480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800]
input_mean: [0.485, 0.456, 0.406]
input_std: [0.229, 0.224, 0.225]
horizontal_flip_prob: 0.5
train_random_resize: [400, 500, 600]
train_random_crop_min: 384
train_random_crop_max: 600
random_resize_max_size: 1333
test_random_resize: 800
model:
backbone: swin_tiny_224_1k
train_backbone: True
num_feature_levels: 4
dec_layers: 6
enc_layers: 6
num_queries: 300
num_queries: 900
dropout_ratio: 0.0
dim_feedforward: 2048
log_scale: auto
class_embed_bias: True # Adding bias in the contrastive embedding layer for training stability
train:
optim:
lr_backbone: 2e-5
lr: 2e-4
lr_steps: [10, 20]
num_epochs: 30
freeze: ["backbone.0", "bert"] # if only finetuning
pretrained_model_path: /path/to/your-gdino-pretrained-model # if only finetuning
precision: bf16 # for efficient training
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
encryption_key |
string | FALSE | |||||
results_dir |
string | /results | FALSE | ||||
wandb |
collection | FALSE | |||||
model |
collection | 用于构建 Grounding DINO 实验模型的配置参数。 | FALSE | ||||
dataset |
collection | 用于构建 Grounding DINO 实验数据集的配置参数。 | FALSE | ||||
训练 |
collection | 用于构建 Grounding DINO 实验训练器的配置参数。 | FALSE | ||||
评估 |
collection | 用于构建 Grounding DINO 实验评估器的配置参数。 | FALSE | ||||
推理 |
collection | 用于构建 Grounding DINO 实验推理器的配置参数。 | FALSE | ||||
导出 |
collection | 用于构建 Grounding DINO 实验导出器的配置参数。 | FALSE | ||||
gen_trt_engine |
collection | 用于构建 Grounding DINO 实验 TensorRT 引擎构建器的配置参数。 | FALSE |
model
model
参数提供了更改 Grounding DINO 架构的选项。
model:
pretrained_model_path: /path/to/your-gdino-pretrained-model
backbone: swin_tiny_224_1k
train_backbone: True
num_feature_levels: 4
dec_layers: 6
enc_layers: 6
num_queries: 300
num_queries: 900
dropout_ratio: 0.0
dim_feedforward: 2048
log_scale: auto
class_embed_bias: True
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
pretrained_backbone_path |
string | [可选] 预训练主干网络文件的路径。 | FALSE | ||||
|
string |
模型的主干网络名称。 |
swin_tiny_224_1k |
|
|
swin_tiny_224_1k,swin_base_224_22k,swin_base_384_22k,swin_large_224_22k,swin_large_384_22k |
FALSE |
num_queries |
int | 查询的数量 | 900 | 1 | inf | TRUE | |
num_feature_levels |
int | 模型中使用的特征层级数 | 4 | 1 | 5 | FALSE | |
set_cost_class |
float | 匹配代价中分类误差的相对权重。 | 1.0 | 0.0 | inf | FALSE | |
set_cost_bbox |
float | 匹配代价中边界框坐标 L1 误差的相对权重。 | 5.0 | 0.0 | inf | FALSE | |
set_cost_giou |
float | 匹配代价中边界框 GIoU 损失的相对权重。 | 2.0 | 0.0 | inf | FALSE | |
cls_loss_coef |
float | 最终损失中分类误差的相对权重。 | 2.0 | 0.0 | inf | FALSE | |
bbox_loss_coef |
float | 最终损失中边界框坐标 L1 误差的相对权重。 | 5.0 | 0.0 | inf | FALSE | |
giou_loss_coef |
float | 最终损失中边界框 GIoU 损失的相对权重。 | 2.0 | 0.0 | inf | FALSE | |
num_select |
int | 后处理期间选择的 Top-K 预测数量 | 300 | 1 | TRUE | ||
interm_loss_coef |
float | 1.0 | FALSE | ||||
no_interm_box_loss |
bool | 无中间 bbox 损失。 | False | FALSE | |||
pre_norm |
bool | 在编码器中添加层归一化的标志。 | False | FALSE | |||
two_stage_type |
string | DINO 中两阶段的类型 | standard | standard,no | FALSE | ||
decoder_sa_type |
string | 解码器自注意力类型。 | sa | sa,ca_label,ca_content | FALSE | ||
embed_init_tgt |
bool | 添加目标嵌入的标志 | True | FALSE | |||
|
int |
如果此值为 -1,则为每个框分别学习宽度和高度。 |
-1 |
-2 |
inf |
|
FALSE |
pe_temperatureH |
int | 应用于位置正弦嵌入高度维度的温度。 | 20 | 1 | inf | FALSE | |
pe_temperatureW |
int | 应用于位置正弦嵌入宽度维度的温度。 | 20 | 1 | inf | FALSE | |
return_interm_indices |
list | 要在模型中使用的特征层级索引。长度必须与 num_feature_levels 匹配。 | [1, 2, 3, 4] | FALSE | |||
use_dn |
bool | 一个标志,指定是否在 DINO 中启用对比去噪训练 | True | FALSE | |||
dn_number |
int | DINO 中的去噪查询数量。 | 0 | 0 | inf | FALSE | |
dn_box_noise_scale |
float | 在对比去噪期间应用于框的噪声比例。如果此值为 0,则不应用噪声。 | 1.0 | 0.0 | inf | FALSE | |
|
float |
应用于标签的噪声比例,在 |
0.5 |
0.0 |
|
|
FALSE |
focal_alpha |
float | 焦点损失中的 alpha 值。 | 0.25 | FALSE | |||
focal_gamma |
float | 焦点损失中的 gamma 值。 | 2.0 | FALSE | |||
clip_max_norm |
float | 0.1 | FALSE | ||||
nheads |
int | 头的数量 | 8 | FALSE | |||
dropout_ratio |
float | 丢弃隐藏单元的概率。 | 0.0 | 0.0 | 1.0 | FALSE | |
hidden_dim |
int | 隐藏单元的维度。 | 256 | FALSE | |||
enc_layers |
int | Transformer 中编码器层数 | 6 | 1 | TRUE | ||
dec_layers |
int | Transformer 中解码器层数。 | 6 | 1 | TRUE | ||
dim_feedforward |
int | 前馈网络的维度。 | 2048 | 1 | FALSE | ||
dec_n_points |
int | 解码器中参考点的数量。 | 4 | 1 | FALSE | ||
enc_n_points |
int | 编码器中参考点的数量。 | 4 | 1 | FALSE | ||
|
bool |
一个标志,指定是否使用辅助 |
True |
|
|
|
FALSE |
dilation |
bool | 一个标志,指定是否在主干网络中启用空洞卷积。 | False | FALSE | |||
|
bool |
标志,用于设置主干网络权重为可训练或冻结。 |
True |
|
|
|
FALSE |
|
string |
BERT 编码器类型。如果仅提供类型名称, |
bert-base-uncased |
|
|
|
FALSE |
max_text_len |
int | BERT 的最大文本长度。 | 256 | 1 | FALSE | ||
class_embed_bias |
bool | 标志,用于在对比嵌入中设置偏置。 | False | FALSE | |||
|
string |
[可选] 可学习参数的初始值,用于乘以相似度 |
none |
|
|
|
FALSE |
loss_types |
list | 训练期间要使用的损失。 | [‘labels’, ‘boxes’] | FALSE | |||
backbone_names |
list | 与主干网络对应的张量名称前缀。 | [‘backbone.0’, ‘bert’] | FALSE | |||
linear_proj_names |
list | 线性投影层名称。 | [‘reference_points’, ‘sampling_offsets’] | FALSE |
训练
train
参数定义了训练过程的超参数。
train:
optim:
lr: 0.0002
lr_backbone: 0.00002
momentum: 0.9
weight_decay: 0.0001
lr_scheduler: MultiStep
lr_steps: [10, 20]
lr_decay: 0.1
num_epochs: 30
checkpoint_interval: 1
precision: bf16
distributed_strategy: ddp
activation_checkpoint: True
num_gpus: 8
num_nodes: 1
freeze: ["backbone.0", "bert"]
pretrained_model_path: /path/to/pretrained/model
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
num_gpus |
int | 运行训练作业的 GPU 数量。 | 1 | 1 | FALSE | ||
gpu_ids |
list | 要在其上运行训练的 GPU ID 列表。此列表的长度必须等于 train.num_gpus 中的 GPU 数量。 | [0] | FALSE | |||
num_nodes |
int | 运行训练的节点数量。如果 > 1,则启用多节点。 | 1 | FALSE | |||
seed |
int | PyTorch 中初始化器的种子。如果 < 0,则禁用固定种子。 | 1234 | -1 | inf | FALSE | |
cudnn |
collection | FALSE | |||||
num_epochs |
int | 运行训练的 epoch 数。 | 10 | 1 | inf | TRUE | |
checkpoint_interval |
int | 保存检查点的时间间隔(以 epoch 为单位)。有助于恢复训练。 | 1 | 1 | FALSE | ||
validation_interval |
int | 验证数据集触发评估的时间间隔(以 epoch 为单位)。 | 1 | 1 | FALSE | ||
resume_training_checkpoint_path |
string | 要从中恢复训练的检查点路径。 | FALSE | ||||
results_dir |
string | 存储从任务生成的所有资产的路径。 | FALSE | ||||
|
list |
要冻结的层名称列表。 |
[] |
|
|
|
FALSE |
pretrained_model_path |
string | 预训练的 Deformable DETR 模型路径,用于从中初始化当前训练。 | FALSE | ||||
|
float |
通过 L2 范数裁剪梯度的量。 |
0.1 |
|
|
|
FALSE |
|
bool |
是否在 Dry Run 模式下运行训练器。这可以用作 |
False |
|
|
|
FALSE |
optim |
collection | 用于配置优化器的超参数。 | FALSE | ||||
precision |
string | 运行训练的精度。 | fp32 | fp16,fp32,bf16 | FALSE | ||
|
string |
多 GPU 训练策略。 |
ddp |
|
|
ddp,fsdp |
FALSE |
|
bool |
True 值指示训练在反向传播中重新计算以节省 GPU 内存, |
True |
|
|
|
FALSE |
verbose |
bool | 标志,用于启用打印来自优化器的详细学习率缩放。 | False | FALSE |
optim
optim
参数定义了训练中优化器的配置,包括学习率、学习率调度器和权重衰减。
optim:
lr: 0.0002
lr_backbone: 0.00002
momentum: 0.9
weight_decay: 0.0001
lr_scheduler: MultiStep
lr_steps: [10, 20]
lr_decay: 0.1
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
optimizer |
string | 用于训练网络的优化器类型。 | AdamW | AdamW,SGD | FALSE | ||
monitor_name |
string | 要为 AutoReduce 调度器监控的指标值。 |
val_loss | val_loss,train_loss | FALSE | ||
lr |
float | 训练模型(不包括主干网络)的初始学习率。 | 0.0002 | TRUE | |||
lr_backbone |
float | 训练主干网络的初始学习率。 | 2e-05 | TRUE | |||
lr_linear_proj_mult |
float | 训练线性投影层的初始学习率。 | 0.1 | TRUE | |||
momentum |
float | AdamW 优化器的动量。 | 0.9 | TRUE | |||
weight_decay |
float | 权重衰减系数。 | 0.0001 | TRUE | |||
|
string |
学习率调度器 |
MultiStep |
|
|
MultiStep,StepLR |
FALSE |
|
list |
必须减少学习率的步数。 |
[10] |
|
|
|
FALSE |
lr_step_size |
int | StepLR 中减少学习率的步数。 | 10 | TRUE | |||
lr_decay |
float | 学习率调度器的递减因子。 | 0.1 | TRUE |
dataset
dataset
参数定义了数据集源、训练批次大小和增强。
dataset:
train_data_sources:
- image_dir: /path/to/coco/train2017/
json_file: /path/to/coco/annotations/instances_train2017.jsonl # odvg format
label_map: /path/to/coco/annotations/instances_train2017_labelmap.json
- image_dir: /path/to/coco/train2017/
json_file: /path/to/coco/annotations/refcoco.jsonl # grounding dataset which doesn't require label_map
val_data_sources:
image_dir: /path/to/coco/val2017/
json_file: /path/to/coco/annotations/instances_val2017_contiguous.json # category ids need to be contiguous
test_data_sources:
image_dir: /path/to/coco/images/val2017/
json_file: /path/to/coco/annotations/instances_val2017.json
infer_data_sources:
- image_dir: /path/to/coco/images/val2017/
captions: ["blackcat", "car"]
max_labels: 80
batch_size: 4
workers: 8
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
|
list |
训练数据源列表 |
[{‘image_dir’: ‘’, ‘json_file’: ‘’, ‘label_map’: ‘’}, {‘image_dir’: ‘’, ‘json_file’: ‘’}] |
|
|
|
FALSE |
|
collection |
验证的数据源 |
{‘image_dir’: ‘’, ‘json_file’: ‘’} |
|
|
|
FALSE |
|
collection |
测试的数据源 |
{‘image_dir’: ‘’, ‘json_file’: ‘’} |
|
|
|
FALSE |
|
collection |
推理的数据源 |
{‘image_dir’: [‘’], ‘captions’: [‘’]} |
|
|
|
FALSE |
batch_size |
int | 训练和验证的批次大小 | 4 | 1 | inf | TRUE | |
workers |
int | 并行处理数据的工作进程数 | 8 | 1 | inf | TRUE | |
|
bool |
标志,用于启用数据加载器分配页锁定内存以加快 |
True |
|
|
|
FALSE |
|
string |
如果设置为 default,则遵循来自 torch 的标准 map-style 数据集结构, |
serialized |
|
|
serialized,default |
FALSE |
|
int |
要从中采样的标签总数。在采样正标签后, |
50 |
1 |
inf |
|
FALSE |
eval_class_ids |
list | 用于评估的类别 ID。 | [1] | FALSE | |||
augmentation |
collection | 数据增强的配置参数。 | FALSE |
augmentation
augmentation
参数包含增强的超参数。
augmentation:
scales: [480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800]
input_mean: [0.485, 0.456, 0.406]
input_std: [0.229, 0.224, 0.225]
horizontal_flip_prob: 0.5
train_random_resize: [400, 500, 600]
train_random_crop_min: 384
train_random_crop_max: 600
random_resize_max_size: 1333
test_random_resize: 800
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
scales |
list | 要对其执行随机调整大小的尺寸列表。 | [480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800] | FALSE | |||
input_mean |
list | RGB 帧的输入均值 | [0.485, 0.456, 0.406] | FALSE | |||
input_std |
list | RGB 帧的每像素输入标准差 | [0.229, 0.224, 0.225] | FALSE | |||
train_random_resize |
list | 用于训练数据的随机调整大小的尺寸列表 | [400, 500, 600] | FALSE | |||
horizontal_flip_prob |
float | 训练期间水平翻转的概率 | 0.5 | 0.0 | 1.0 | TRUE | |
train_random_crop_min |
int | 训练数据的最小随机裁剪尺寸 | 384 | 1 | inf | TRUE | |
train_random_crop_max |
int | 训练数据的最大随机裁剪尺寸 | 600 | 1 | inf | TRUE | |
random_resize_max_size |
int | 训练数据的最大随机调整大小尺寸 | 1333 | 1 | inf | TRUE | |
test_random_resize |
int | 测试数据的随机调整大小尺寸 | 800 | 1 | inf | TRUE | |
|
bool |
一个标志,指定是否将图像调整大小(不进行填充)为 |
TRUE |
|
|
|
FALSE |
|
int |
一个标志,用于启用大规模抖动 (Large Scale Jittering),用于 ViT 主干网络。 |
1024 |
1 |
inf |
|
FALSE |
要训练 Grounding DINO 模型,请使用此命令
tao model grounding_dino train [-h] -e <experiment_spec>
必需参数
-e, --experiment_spec
:实验规范文件,用于设置训练实验。
可选参数
-h, --help
:显示此帮助消息并退出。
示例用法
以下是 train
命令的示例
tao grounding_dino model train -e /path/to/spec.yaml
优化资源以训练 Grounding DINO
训练 Grounding DINO 需要强大的 GPU(例如:V100/A100),至少具有 15GB 的 VRAM 和大量 CPU 内存,才能在像 COCO 这样的标准数据集上进行训练。本节概述了在资源有限的情况下启动训练的一些策略。
优化 GPU 内存
有多种方法可以优化 GPU 内存使用。一种技巧是减少 dataset.batch_size
。但是,这可能会导致您的训练时间比平时更长。我们建议设置以下配置以优化 GPU 消耗
将
train.precision
设置为bf16
以启用自动混合精度训练。这可以将您的 GPU 内存使用量减少 50%。将
train.activation_checkpoint
设置为True
以启用激活检查点。通过重新计算激活而不是将其缓存到内存中,可以提高内存使用率。将
train.distributed_strategy
设置为fsdp
以启用完全分片数据并行训练。这会在不同进程之间共享梯度计算,以帮助减少 GPU 内存。尝试使用更轻量级的主干网络,如
swin_tiny_224_1k
,或通过将model.train_backbone
设置为 False 来冻结主干网络。尝试根据您的数据集更改
dataset.augmentation
中的增强分辨率。
优化 CPU 内存
为了加快数据加载速度,通常您会设置大量工作进程以生成多个进程。但是,如果您的注释文件非常大,这可能会导致您的 CPU 内存不足。我们建议设置以下配置以优化 CPU 消耗
将
dataset.dataset_type
设置为serialized
,以便可以跨不同子进程共享基于 COCO 的注释数据。将
dataset.augmentation.fixed_padding
设置为 True,以便在批次制定之前填充图像。由于训练期间的随机调整大小和随机裁剪增强,变换后生成的图像分辨率可能因图像而异。这种可变的图像分辨率可能会导致内存泄漏,并且 CPU 内存会缓慢堆积,直到在训练过程中内存不足。这是 PyTorch 的限制,因此我们建议将fixed_padding
设置为 True,以帮助稳定 CPU 内存使用率。
评估
evaluate
参数定义了评估过程的超参数。
evaluate:
checkpoint: /path/to/model.pth
conf_threshold: 0.0
num_gpus: 1
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
num_gpus |
int | 1 | FALSE | ||||
gpu_ids |
list | [0] | FALSE | ||||
num_nodes |
int | 1 | FALSE | ||||
checkpoint |
string | ??? | FALSE | ||||
results_dir |
string | FALSE | |||||
input_width |
int | 输入图像张量的宽度。 | 1 | FALSE | |||
input_height |
int | 输入图像张量的高度。 | 1 | FALSE | |||
|
string |
用于评估的 TensorRT 引擎的路径。 |
|
|
|
|
FALSE |
|
float |
置信度阈值的值,用于 |
0.0 |
|
|
|
FALSE |
要使用 Grounding DINO 模型运行评估,请使用此命令
tao model grounding_dino evaluate [-h] -e <experiment_spec> \
evaluate.checkpoint=<model to be evaluated>
必需参数
-e, --experiment_spec
:实验规范文件,用于设置评估实验。
可选参数
evaluate.checkpoint
:要评估的.pth
模型。
示例用法
以下是使用 evaluate
命令的示例
tao model grounding_dino evaluate -e /path/to/spec.yaml evaluate.checkpoint=/path/to/model.pth
推理
inference
参数定义了推理过程的超参数。
inference:
checkpoint: /path/to/model.pth
conf_threshold: 0.5
num_gpus: 1
color_map:
"blackcat": red
car: blue
dataset:
infer_data_sources:
image_dir: /data/raw-data/val2017/
captions: ["blackcat", "cat"]
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
num_gpus |
int | 1 | FALSE | ||||
gpu_ids |
list | [0] | FALSE | ||||
num_nodes |
int | 1 | FALSE | ||||
checkpoint |
string | ??? | FALSE | ||||
results_dir |
string | FALSE | |||||
|
string |
用于评估的 TensorRT 引擎的路径。 |
|
|
|
|
FALSE |
color_map |
collection | 类别的颜色字典,用于渲染框。 | FALSE | ||||
|
float |
置信度阈值的值,用于 |
0.5 |
|
|
|
FALSE |
is_internal |
bool | 标志,用于使用内部目录结构渲染。 | False | FALSE | |||
input_width |
int | 输入图像张量的宽度。 | 960 | 32 | FALSE | ||
input_height |
int | 输入图像张量的高度。 | 544 | 32 | FALSE | ||
outline_width |
int | 边界框轮廓的像素宽度。 | 3 | 1 | FALSE |
Grounding DINO 模型的推理工具可用于可视化边界框,并在图像目录上生成逐帧 KITTI 格式标签。
tao model grounding_dino inference [-h] -e <experiment spec file>
inference.checkpoint=<model to be inferenced>
必需参数
-e, --experiment_spec
:实验规范文件,用于设置推理实验。
可选参数
inference.checkpoint
:要推理的.pth
模型。
示例用法
以下是使用 inference
命令的示例
tao model grounding_dino inference -e /path/to/spec.yaml inference.checkpoint=/path/to/model.pth
导出
export
参数定义了导出过程的超参数。
export:
checkpoint: /path/to/model.pth
onnx_file: /path/to/model.onnx
on_cpu: False
opset_version: 17
input_channel: 3
input_width: 960
input_height: 544
batch_size: -1
字段 |
value_type |
描述 |
default_value |
valid_min |
valid_max |
valid_options |
automl_enabled |
---|---|---|---|---|---|---|---|
results_dir |
string | 存储从任务生成的所有资产的路径。 | FALSE | ||||
gpu_id |
int | 用于构建 TensorRT 引擎的 GPU 索引。 | 0 | FALSE | |||
checkpoint |
string | 要运行导出的检查点文件路径。 | ??? | FALSE | |||
onnx_file |
string | onnx 模型文件的路径。 | ??? | FALSE | |||
on_cpu |
bool | 标志,用于导出 CPU 兼容模型。 | False | FALSE | |||
input_channel |
int | 输入张量中的通道数。 | 3 | 3 | FALSE | ||
input_width |
int | 输入图像张量的宽度。 | 960 | 32 | FALSE | ||
input_height |
int | 输入图像张量的高度。 | 544 | 32 | FALSE | ||
opset_version |
int |
|
17 | 1 | FALSE | ||
batch_size |
int |
|
-1 | -1 | FALSE | ||
verbose |
bool | 标志,用于启用详细的 TensorRT 日志记录。 | False | FALSE |
tao model grounding_dino export [-h] -e <experiment spec file>
export.checkpoint=<model to export>
export.onnx_file=<onnx path>
必需参数
-e, --experiment_spec
:实验规范文件的路径。
可选参数
export.checkpoint
:要导出的.pth
模型。export.onnx_file
:保存.onnx
模型的路径。
示例用法
以下是使用 export
命令的示例
tao model grounding_dino export -e /path/to/spec.yaml export.checkpoint=/path/to/model.pth export.onnx_file=/path/to/model.onnx