Migrating from TAO Toolkit 4.0.x to TAO Toolkit 5.0.0

To migrate to TAO Toolkit 5.0.0, you must first upgrade your TAO workflows to TAO 4.0.0. Follow these instructions to upgrade from an older version of TAO Toolkit (previously named “Transfer Learning Toolkit”) to version 4.0.x.

In version 5.0.0, TAO Toolkit introduces the notion of a task_group, which is a collection of tasks that can be associated with a specific modality. The following are supported modalities:

  • model

  • dataset

  • deploy

All models that were included as tasks until 4.0.x are now grouped under the model task group. All the tasks that were included as part of the tao-deploy CLI are now grouped under the deploy task group.

The task_group dataset has been introduced in TAO Toolkit 5.0.0. It includes tasks and associated sub-tasks that help with generating labels from raw images (autolabel), inspecting and validating a pre-existing annotated dataset (analytics), converting a pre-existing annotated dataset (annotation) from one format to another (e.g. from KITTI to COCO), and enhancing a dataset by running offline augmentation (augmentation).

For more information on the dataset task group, refer to the Data Services chapter.

The table below shows a summary of the expected changes in the CLI. This is not an exhaustive list of all actions, but these changes can be generalized to all networks included as part of TAO Toolkit 4.0.x.

Network

TAO Toolkit 4.0.x

TAO Toolkit 5.0.x

Classification
Copy
Copied!
            

tao classification_tf1 export \ -m $USER_EXPERIMENT_DIR/output_retrain/weights/resnet_$EPOCH.tlt \ -o $USER_EXPERIMENT_DIR/export/final_model.etlt \ -k $KEY \ --classmap_json $USER_EXPERIMENT_DIR/output_retrain/classmap.json \ --gen_ds_config tao-deploy classification_tf1 gen_trt_engine \ -m $USER_EXPERIMENT_DIR/export/final_model.etlt \ -e $SPECS_DIR/classification_retrain_spec.cfg \ -k $KEY \ --batch_size 64 \ --max_batch_size 64 \ --batches 10 \ --data_type int8 \ --cal_data_file $USER_EXPERIMENT_DIR/export/calibration.tensor \ --cal_cache_file $USER_EXPERIMENT_DIR/export/final_model_int8_cache.bin \ --cal_image_dir $DATA_DOWNLOAD_DIR/split/test/ \ --engine_file $USER_EXPERIMENT_DIR/export/final_model.trt

Copy
Copied!
            

tao model classification_tf1 export \ -m $USER_EXPERIMENT_DIR/output_retrain/weights/resnet_$EPOCH.hdf5 \ -o $USER_EXPERIMENT_DIR/export/final_model.onnx \ -k $KEY \ --classmap_json $USER_EXPERIMENT_DIR/output_retrain/classmap.json \ --gen_ds_config tao deploy classification_tf1 gen_trt_engine \ -m $USER_EXPERIMENT_DIR/export/final_model.onnx \ -e $SPECS_DIR/classification_retrain_spec.cfg \ -k $KEY \ --batch_size 64 \ --max_batch_size 64 \ --batches 10 \ --data_type int8 \ --cal_data_file $USER_EXPERIMENT_DIR/export/calibration.tensor \ --cal_cache_file $USER_EXPERIMENT_DIR/export/final_model_int8_cache.bin \ --cal_image_dir $DATA_DOWNLOAD_DIR/split/test/ \ --engine_file $USER_EXPERIMENT_DIR/export/final_model.trt

DetectNet_v2
Copy
Copied!
            

tao detectnet_v2 export \ -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/weights/resnet18_detector_pruned.tlt \ -e $SPECS_DIR/detectnet_v2_retrain_resnet18_kitti.txt \ -o $USER_EXPERIMENT_DIR/experiment_dir_final/resnet18_detector.etlt \ -k $KEY \ --gen_ds_config tao-deploy detectnet_v2 gen_trt_engine \ -m $USER_EXPERIMENT_DIR/experiment_dir_final/resnet18_detector.etlt \ -k $KEY \ --data_type int8 \ --batches 10 \ --batch_size 4 \ --max_batch_size 64 \ --engine_file $USER_EXPERIMENT_DIR/experiment_dir_final/resnet18_detector.trt.int8 \ --cal_cache_file $USER_EXPERIMENT_DIR/experiment_dir_final/calibration.bin \ -e $SPECS_DIR/detectnet_v2_retrain_resnet18_kitti.txt \ --verbose

Copy
Copied!
            

tao model detectnet_v2 export \ -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/weights/resnet18_detector_pruned.hdf5 \ -e $SPECS_DIR/detectnet_v2_retrain_resnet18_kitti.txt \ -o $USER_EXPERIMENT_DIR/experiment_dir_final/resnet18_detector.onnx \ -k $KEY \ --gen_ds_config tao deploy detectnet_v2 gen_trt_engine \ -m $USER_EXPERIMENT_DIR/experiment_dir_final/resnet18_detector.onnx \ -k $KEY \ --data_type int8 \ --batches 10 \ --batch_size 4 \ --max_batch_size 64 \ --engine_file $USER_EXPERIMENT_DIR/experiment_dir_final/resnet18_detector.trt.int8 \ --cal_cache_file $USER_EXPERIMENT_DIR/experiment_dir_final/calibration.bin \ -e $SPECS_DIR/detectnet_v2_retrain_resnet18_kitti.txt \ --verbose

EfficientDet
Copy
Copied!
            

tao efficientdet_tf1 export -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/model.step-$NUM_STEP.tlt \ -o $USER_EXPERIMENT_DIR/experiment_dir_retrain/model.step-$NUM_STEP.etlt \ -k $KEY \ -e $SPECS_DIR/efficientdet_d0_retrain.txt tao-deploy efficientdet_tf1 gen_trt_engine -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/model.step-$NUM_STEP.etlt \ -k $KEY \ --batch_size 8 \ --data_type int8 \ --cal_image_dir $DATA_DOWNLOAD_DIR/raw-data/val2017 \ --batches 10 \ --min_batch_size 1 \ --opt_batch_size 8 \ --max_batch_size 16 \ --cal_cache_file $USER_EXPERIMENT_DIR/export/efficientdet_d0.cal \ --engine_file $USER_EXPERIMENT_DIR/export/trt.int8.engine

Copy
Copied!
            

tao model efficientdet_tf1 export -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/model.step-$NUM_STEP.hdf5 \ -o $USER_EXPERIMENT_DIR/experiment_dir_retrain/model.step-$NUM_STEP.onnx \ -k $KEY \ -e $SPECS_DIR/efficientdet_d0_retrain.txt tao deploy efficientdet_tf1 gen_trt_engine -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/model.step-$NUM_STEP.onnx \ -k $KEY \ --batch_size 8 \ --data_type int8 \ --cal_image_dir $DATA_DOWNLOAD_DIR/raw-data/val2017 \ --batches 10 \ --min_batch_size 1 \ --opt_batch_size 8 \ --max_batch_size 16 \ --cal_cache_file $USER_EXPERIMENT_DIR/export/efficientdet_d0.cal \ --engine_file $USER_EXPERIMENT_DIR/export/trt.int8.engine

SSD
Copy
Copied!
            

tao ssd export --gpu_index=$GPU_INDEX \ -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/weights/ssd_resnet18_epoch_$EPOCH.tlt \ -k $KEY \ -o $USER_EXPERIMENT_DIR/export/ssd_resnet18_epoch_$EPOCH.etlt \ -e $SPECS_DIR/ssd_retrain_resnet18_kitti.txt \ --batch_size 16 \ --gen_ds_config tao-deploy ssd gen_trt_engine --gpu_index=$GPU_INDEX \ -m $USER_EXPERIMENT_DIR/export/ssd_resnet18_epoch_$EPOCH.etlt \ -k $KEY \ -e $SPECS_DIR/ssd_retrain_resnet18_kitti.txt \ --engine_file $USER_EXPERIMENT_DIR/export/trt.engine \ --cal_image_dir $DATA_DOWNLOAD_DIR/testing/image_2 \ --data_type int8 \ --max_batch_size 16 \ --batch_size 16 \ --batches 10 \ --cal_cache_file $USER_EXPERIMENT_DIR/export/cal.bin \ --cal_data_file $USER_EXPERIMENT_DIR/export/cal.tensorfile

Copy
Copied!
            

tao model ssd export --gpu_index=$GPU_INDEX \ -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/weights/ssd_resnet18_epoch_$EPOCH.hdf5 \ -k $KEY \ -o $USER_EXPERIMENT_DIR/export/ssd_resnet18_epoch_$EPOCH.onnx \ -e $SPECS_DIR/ssd_retrain_resnet18_kitti.txt \ --batch_size 16 \ --gen_ds_config tao deploy ssd gen_trt_engine --gpu_index=$GPU_INDEX \ -m $USER_EXPERIMENT_DIR/export/ssd_resnet18_epoch_$EPOCH.onnx \ -k $KEY \ -e $SPECS_DIR/ssd_retrain_resnet18_kitti.txt \ --engine_file $USER_EXPERIMENT_DIR/export/trt.engine \ --cal_image_dir $DATA_DOWNLOAD_DIR/testing/image_2 \ --data_type int8 \ --max_batch_size 16 \ --batch_size 16 \ --batches 10 \ --cal_cache_file $USER_EXPERIMENT_DIR/export/cal.bin \ --cal_data_file $USER_EXPERIMENT_DIR/export/cal.tensorfile

UNet
Copy
Copied!
            

tao unet export --gpu_index=$GPU_INDEX -m $USER_EXPERIMENT_DIR/isbi_experiment_retrain/weights/model_isbi_retrained.tlt \ -k $KEY \ -e $SPECS_DIR/unet_train_resnet_unet_isbi_retrain.txt \ --gen_ds_config tao-deploy unet gen_trt_engine --gpu_index=$GPU_INDEX -m $USER_EXPERIMENT_DIR/isbi_experiment_retrain/weights/model_isbi_retrained.etlt \ -k $KEY \ -e $SPECS_DIR/unet_train_resnet_unet_isbi_retrain.txt \ --data_type int8 \ --engine_file $USER_EXPERIMENT_DIR/export/int8.isbi.retrained.engine \ --data_type int8 \ --cal_data_file $USER_EXPERIMENT_DIR/export/isbi_cal_data_file.txt \ --cal_cache_file $USER_EXPERIMENT_DIR/export/isbi_cal.bin \ --cal_image_dir $DATA_DOWNLOAD_DIR/isbi/images/val \ --max_batch_size 3 \ --batch_size 1

Copy
Copied!
            

tao model unet export --gpu_index=$GPU_INDEX -m $USER_EXPERIMENT_DIR/isbi_experiment_retrain/weights/model_isbi_retrained.tlt \ -k $KEY \ -e $SPECS_DIR/unet_train_resnet_unet_isbi_retrain.txt \ --gen_ds_config tao deploy unet gen_trt_engine --gpu_index=$GPU_INDEX -m $USER_EXPERIMENT_DIR/isbi_experiment_retrain/weights/model_isbi_retrained.onnx \ -k $KEY \ -e $SPECS_DIR/unet_train_resnet_unet_isbi_retrain.txt \ --data_type int8 \ --engine_file $USER_EXPERIMENT_DIR/export/int8.isbi.retrained.engine \ --data_type int8 \ --cal_data_file $USER_EXPERIMENT_DIR/export/isbi_cal_data_file.txt \ --cal_cache_file $USER_EXPERIMENT_DIR/export/isbi_cal.bin \ --cal_image_dir $DATA_DOWNLOAD_DIR/isbi/images/val \ --max_batch_size 3 \ --batch_size 1

YOLOv3
Copy
Copied!
            

tao yolo_v3 export -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/weights/yolov3_resnet18_epoch_$EPOCH.tlt \ -k $KEY \ -o $USER_EXPERIMENT_DIR/export/yolov3_resnet18_epoch_$EPOCH.etlt \ -e $SPECS_DIR/yolo_v3_retrain_resnet18_tfrecord.txt \ --gen_ds_config tao-deploy yolo_v3 gen_trt_engine -m $USER_EXPERIMENT_DIR/export/yolov3_resnet18_epoch_$EPOCH.etlt \ -k $KEY \ -e $SPECS_DIR/yolo_v3_retrain_resnet18_tfrecord.txt \ --cal_image_dir $DATA_DOWNLOAD_DIR/testing/image_2 \ --data_type int8 \ --batch_size 16 \ --min_batch_size 1 \ --opt_batch_size 8 \ --max_batch_size 16 \ --batches 10 \ --cal_cache_file $USER_EXPERIMENT_DIR/export/cal.bin \ --cal_data_file $USER_EXPERIMENT_DIR/export/cal.tensorfile \ --engine_file $USER_EXPERIMENT_DIR/export/trt.engine.int8

Copy
Copied!
            

tao model yolo_v3 export -m $USER_EXPERIMENT_DIR/experiment_dir_retrain/weights/yolov3_resnet18_epoch_$EPOCH.hdf5 \ -k $KEY \ -o $USER_EXPERIMENT_DIR/export/yolov3_resnet18_epoch_$EPOCH.onnx \ -e $SPECS_DIR/yolo_v3_retrain_resnet18_tfrecord.txt \ --gen_ds_config tao deploy yolo_v3 gen_trt_engine -m $USER_EXPERIMENT_DIR/export/yolov3_resnet18_epoch_$EPOCH.onnx \ -k $KEY \ -e $SPECS_DIR/yolo_v3_retrain_resnet18_tfrecord.txt \ --cal_image_dir $DATA_DOWNLOAD_DIR/testing/image_2 \ --data_type int8 \ --batch_size 16 \ --min_batch_size 1 \ --opt_batch_size 8 \ --max_batch_size 16 \ --batches 10 \ --cal_cache_file $USER_EXPERIMENT_DIR/export/cal.bin \ --cal_data_file $USER_EXPERIMENT_DIR/export/cal.tensorfile \ --engine_file $USER_EXPERIMENT_DIR/export/trt.engine.int8

© Copyright 2023, NVIDIA.. Last updated on Dec 8, 2023.