How to get anchor shape for yolov4_tiny network type on COCO dataset format

Please provide the following information when requesting support.

• Hardware (T4/V100/Xavier/Nano/etc) : Tesla T4
• Network Type (Detectnet_v2/Faster_rcnn/Yolo_v4/LPRnet/Mask_rcnn/Classification/etc) : yolov4_tiny
• TLT Version (Please run “tlt info --verbose” and share “docker_tag” here) : 5.0.0-tf1.15.5
• 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’m trying to train a yolov4_tiny model on custom dataset which is in COCO format. How can i get the best anchor shape’s with kmeans subtask, it only allow the directory not the COCO.json file.

Here is error i’m getting :

Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v4/scripts/”, line 26, in
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v3/scripts/”, line 237, in main
results = kmeans(w, h, args.num_clusters, args.max_steps)
File “/usr/local/lib/python3.8/dist-packages/nvidia_tao_tf1/cv/yolo_v3/scripts/”, line 188, in kmeans
assert num_clusters < len(w), “Must have more boxes than clusters”
AssertionError: Must have more boxes than clusters
Execution status: FAIL

Command used :
tao model yolo_v4_tiny kmeans -l /home/ubuntu/d2_obj/dataset/frames/train/_annotations.coco.json -i /home/ubuntu/d2_obj/dataset/frames/train -n 6 -x 1248 -y 384

The kmeans script can only run against KITTI format label file. See tao_tensorflow1_backend/nvidia_tao_tf1/cv/yolo_v3/scripts/ at 2ec95cbbe0d74d6a180ea6e989f64d2d97d97712 · NVIDIA/tao_tensorflow1_backend · GitHub.

Suggest you to leverage Script to convert MS COCO annotations file to Kitti bounding box label files Edit · GitHub to convert the COCO format label to KITTI format label.

1 Like

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