Generate tfrecords for a KITTI dataset with negative examples

Hello,

I have a KITTI dataset that I’m trying to generate tfrecords for using the TAO toolkit, my dataset contains negative images (images with no objects to detect) with a corresponding empty labels file. And when I try to convert using the following command:

$ tao yolo_v4_tiny dataset_convert -d $SPECS_DIR/yolo_v4_tiny_tfrecords_kitti_train.txt \
                             -o $DATA_DOWNLOAD_DIR/training/tfrecords/train

I get the following error:


/usr/local/lib/python3.6/dist-packages/iva/detectnet_v2/dataio/kitti_converter_lib.py:315: UserWarning: genfromtxt: Empty input file: “/workspace/tao-experiments/data/training/labels/197_24_249_200_01_20220315170624352_1_10200.txt”

File “/root/.cache/bazel/_bazel_root/ed34e6d125608f91724fda23656f1726/execroot/ai_infra/bazel-out/k8-fastbuild/bin/magnet/packages/iva/build_wheel.runfiles/ai_infra/iva/detectnet_v2/dataio/kitti_converter_lib.py”, line 321, in _add_targets
AssertionError: Ground truth kitti labels should have only 15 fields.
2022-06-11 15:58:38,670 [INFO] tlt.components.docker_handler.docker_handler: Stopping container.

Is there anyway to fix this? Or is it mandatory to have no negative images in my dataset?

• Hardware: GTX1650Ti
• Network Type: Yolo_v4 tiny
• TLT Version (Please run “tlt info --verbose” and share “docker_tag” here)
• How to reproduce the issue ? Generate tfrecords using TAO for a kitti dataset that contains at least one empty labels file.

Please make sure kitti labels should have only 15 fields. See Data Annotation Format — TAO Toolkit 3.22.05 documentation

I resolved the problem, it turns out that the repo that used to convert from YOLO to KITTI generated an extra field:

For now, I forked the repo and changed the number of generated fields to 15, this is a link to the forked repo for anyone who wants a quick and dirty fix:

Thanks for the info.

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