Tao detectnet_v2 dataset_convert

Please provide the following information when requesting support.

• Hardware (T4/V100/Xavier/Nano/etc)
Azure VM A100
• Network Type (Detectnet_v2/Faster_rcnn/Yolo_v4/LPRnet/Mask_rcnn/Classification/etc)
Detectnet_v2
• TLT Version (Please run “tlt info --verbose” and share “docker_tag” here)
• Training spec file(If have, please share here)
• How to reproduce the issue ? (This is for errors. Please share the command line and the detailed log here.)

I was running a VM instance in Azure following this here. Im trying to perform transfer learning on custom dataset using Detectnet_v2 – mobilenet_v1 model preferably but i can use resnet18 since it looks like the jupyter notebook is already configured for it. i have my custom dataset with the same required names and structure, ive even provided a testing directory like this:

$LOCAL_PROJECT_DIR/data/training/image_2

$LOCAL_PROJECT_DIR/data/training/label_2

$LOCAL_DATA_DIR/testing/image_2

everything seems to be going right, although i have python 3.8.10 which i believe would still work (could be wrong). but anyways, i skip downloading the dataset section but i still verify and i have the images in the correct path.

the problem comes when i try to prepare tf records from the dataset.

cell:

print("TFrecords conversion spec file for kitti training")
!cat $LOCAL_SPECS_DIR/detectnet_v2_tfrecords_kitti_trainval.txt

output:

TFrecords conversion spec file for kitti training
kitti_config {
  root_directory_path: "/workspace/tao-experiments/data/training"
  image_dir_name: "image_2"
  label_dir_name: "label_2"
  image_extension: ".jpg"
  partition_mode: "random"
  num_partitions: 2
  val_split: 14
  num_shards: 10
}
image_directory_path: "/workspace/tao-experiments/data/training"

cell:

# Creating a new directory for the output tfrecords dump.
print("Converting Tfrecords for kitti trainval dataset")
!mkdir -p $LOCAL_DATA_DIR/tfrecords && rm -rf $LOCAL_DATA_DIR/tfrecords/*
!tao detectnet_v2 dataset_convert \
                  -d $SPECS_DIR/detectnet_v2_tfrecords_kitti_trainval.txt \
                  -o $DATA_DOWNLOAD_DIR/tfrecords/kitti_trainval/kitti_trainval

output

Converting Tfrecords for kitti trainval dataset
usage: tao [-h] {list,stop,info,dataset,deploy,model} ...
tao: error: invalid choice: 'detectnet_v2' (choose from 'list', 'stop', 'info', 'dataset', 'deploy', 'model')

It makes the tfrecords directory but does not create the records.

cell:

!ls -rlt $LOCAL_DATA_DIR/tfrecords/kitti_trainval/

output

ls: cannot access '/home/azureuser/tao/data/tfrecords/kitti_trainval/': No such file or directory

You are following https://docs.nvidia.com/tao/tao-toolkit/text/running_in_cloud/running_tao_toolkit_on_azure.html#downloading-and-running-the-test-samples ,right?

The description is a bit old since the latest notebook version is 5.0. You can find and download it in TAO Toolkit Getting Started | NVIDIA NGC
i.e.,
TAO Toolkit Quick Start Guide - NVIDIA Docs

wget --content-disposition https://api.ngc.nvidia.com/v2/resources/nvidia/tao/tao-getting-started/versions/5.0.0/zip -O getting_started_v5.0.0.zip
unzip -u getting_started_v5.0.0.zip -d ./getting_started_v5.0.0 && rm -rf getting_started_v5.0.0.zip && cd ./getting_started_v5.0.0

Then, for detectnet_v2, its notebook is GPU-optimized AI, Machine Learning, & HPC Software | NVIDIA NGC.

!tao model detectnet_v2 dataset_convert \
                  -d $SPECS_DIR/detectnet_v2_tfrecords_kitti_trainval.txt \
                  -o $DATA_DOWNLOAD_DIR/tfrecords/kitti_trainval/kitti_trainval \
                  -r $USER_EXPERIMENT_DIR/

thank you, that worked. I have a question, if i wanted to train other models are the detectnet_v2 training files provided somewhere or do we have to write those ourselves.
like these files here is what im talking about: detectnet_v2_train_resnet18_kitti.txt

You can find the spec files after downloading the notebook.

wget --content-disposition https://api.ngc.nvidia.com/v2/resources/nvidia/tao/tao-getting-started/versions/5.0.0/zip -O getting_started_v5.0.0.zip
unzip -u getting_started_v5.0.0.zip -d ./getting_started_v5.0.0 && rm -rf getting_started_v5.0.0.zip && cd ./getting_started_v5.0.0

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.