Convert custom dataset using nvidia tao

i’m trying to convert custom dataset teeth dataset with nvidia tao but it returns this error :
$ sudo docker run -it --rm --gpus all --ipc=host --ulimit memlock=-1 --ulimit stack=67108864 -v /home/mj/tao-experiments:/home/mj/tao-experiments nvcr.io/nvidia/tao/tao-toolkit:4.0.1-tf1.15.5 mask_rcnn dataset_convert -i /home/mj/tao-experiments/data_teeth_split/data_teeth/train/images -a /home/mj/tao-experiments/data_teeth_split/data_teeth/train/train_ann.json -o /home/mj/tao-experiments/data/train --include_masks -t train -s 256

==============================
=== TAO Toolkit TensorFlow ===

NVIDIA Release 4.0.1-TensorFlow (build )
TAO Toolkit Version 4.0.1

Various files include modifications (c) NVIDIA CORPORATION & AFFILIATES. All rights reserved.

This container image and its contents are governed by the TAO Toolkit End User License Agreement.
By pulling and using the container, you accept the terms and conditions of this license:

Using TensorFlow backend.
2023-06-13 08:38:54.546853: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
/usr/local/lib/python3.6/dist-packages/requests/init.py:91: RequestsDependencyWarning: urllib3 (1.26.5) or chardet (3.0.4) doesn’t match a supported version!
RequestsDependencyWarning)
2023-06-13 08:38:57.802169: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
2023-06-13 08:38:58.245479: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libnvinfer.so.8
2023-06-13 08:38:58.260103: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
/usr/local/lib/python3.6/dist-packages/requests/init.py:91: RequestsDependencyWarning: urllib3 (1.26.5) or chardet (3.0.4) doesn’t match a supported version!
RequestsDependencyWarning)
Using TensorFlow backend.
INFO:tensorflow:writing to output path: /home/mj/tao-experiments/data/train/train
INFO:tensorflow:writing to output path: /home/mj/tao-experiments/data/train/train
INFO:tensorflow:Building bounding box index.
INFO:tensorflow:Building bounding box index.
INFO:tensorflow:0 images are missing bboxes.
INFO:tensorflow:0 images are missing bboxes.
multiprocessing.pool.RemoteTraceback:
“”"
Traceback (most recent call last):
File “/usr/lib/python3.6/multiprocessing/pool.py”, line 119, in worker
result = (True, func(*args, **kwds))
File “”, line 199, in _pool_create_tf_example
File “”, line 110, in create_tf_example
KeyError: 7
“”"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “</usr/local/lib/python3.6/dist-packages/iva/mask_rcnn/scripts/dataset_convert.py>”, line 3, in
File “”, line 415, in
File “”, line 403, in
File “”, line 318, in main
File “”, line 269, in _create_tf_record_from_coco_annotations
File “/usr/lib/python3.6/multiprocessing/pool.py”, line 735, in next
raise value
KeyError: 7
Telemetry data couldn’t be sent, but the command ran successfully.
[WARNING]: <urlopen error [Errno -2] Name or service not known>
Execution status: FAIL

Knowing that I convert my annotation to coco annotation and visualize my data and its correct !
some of my json file annotation :
{“info”: {“description”: “COCO Dataset”, “url”: “http://cocodataset.org”, “version”: “1.0”, “year”: 2023, “contributor”: “Your Name”, “date_created”: “2023-06-12”}, “licenses”: , “images”: [{“license”: 0, “file_name”: “supervisely##d1097b4898634c83b51f86a7ffe83405_4.png”, “height”: 533, “width”: 802, “date_captured”: “”, “id”: 1}, {“license”: 0, “file_name”: “supervisely##charlesg_79#0_4.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 2}, {“license”: 0, “file_name”: “supervisely##ee905623f94b4af5b6e8254d6de68056_2.png”, “height”: 533, “width”: 802, “date_captured”: “”, “id”: 3}, {“license”: 0, “file_name”: “supervisely##ben_adultes_7_0.png”, “height”: 533, “width”: 947, “date_captured”: “”, “id”: 4}, {“license”: 0, “file_name”: “supervisely##e92149542f9148b387c1b111216ccad6_6.png”, “height”: 533, “width”: 802, “date_captured”: “”, “id”: 5}, {“license”: 0, “file_name”: “supervisely##charlesg_69#0_4.png”, “height”: 533, “width”: 804, “date_captured”: “”, “id”: 6}, {“license”: 0, “file_name”: “supervisely##ebd9a88264fa457f8d06f9eed5f08c48_3.png”, “height”: 533, “width”: 802, “date_captured”: “”, “id”: 7}, {“license”: 0, “file_name”: “supervisely##charlesg_76#0_2.png”, “height”: 533, “width”: 804, “date_captured”: “”, “id”: 8}, {“license”: 0, “file_name”: “supervisely##charlesg_74#0_1.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 9}, {“license”: 0, “file_name”: “supervisely##charlesg_74#0_0.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 10}, {“license”: 0, “file_name”: “supervisely##ben_adultes_5_0.png”, “height”: 533, “width”: 947, “date_captured”: “”, “id”: 11}, {“license”: 0, “file_name”: “supervisely##charlesg_65#0_3.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 12}, {“license”: 0, “file_name”: “supervisely##charlesg_94#0_1.png”, “height”: 533, “width”: 804, “date_captured”: “”, “id”: 13}, {“license”: 0, “file_name”: “supervisely##charlesg_101#0_1.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 14}, {“license”: 0, “file_name”: “supervisely##c8da773e06d340feb20b3a122e53b127_0.png”, “height”: 533, “width”: 802, “date_captured”: “”, “id”: 15}, {“license”: 0, “file_name”: “supervisely##charlesg_82#0_2.png”, “height”: 533, “width”: 804, “date_captured”: “”, “id”: 16}, {“license”: 0, “file_name”: “supervisely##ben_adultes_13_2.png”, “height”: 533, “width”: 947, “date_captured”: “”, “id”: 17}, {“license”: 0, “file_name”: “supervisely##charlesg_75#0_2.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 18}, {“license”: 0, “file_name”: “supervisely##charlesg_102#0_2.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 19}, {“license”: 0, “file_name”: “supervisely##charlesg_71#0_4.png”, “height”: 533, “width”: 801, “date_captured”: “”, “id”: 20}, {“license”: 0, “file_name”: “supervisely##ben_adultes_8_0.png”, “height”: 533, “width”: 947, “date_captured”: “”, “id”: 21}, {“license”: 0, “file_name”: “supervisely##ben_adultes_0_4.png”, “height”: 533, “width”: 710, “date_captured”: “”, “id”: 22}, …



{“license”: 0, “file_name”: “supervisely##charlesg_84#0_0.png”, “height”: 533, “width”: 804, “date_captured”: “”, “id”: 184}], “annotations”: [{“segmentation”: [[337, 104, 339, 95, 347, 82, 355, 72, 367, 64, 384, 59, 396, 61, 404, 62, 413, 67, 422, 74, 429, 84, 428, 89, 424, 122, 422, 126, 419, 131, 405, 131, 399, 135, 389, 138, 375, 136, 365, 132, 357, 123, 348, 123, 343, 120, 336, 111]], “area”: 7347, “iscrowd”: 0, “image_id”: 1, “bbox”: [336, 59, 93, 79], “category_id”: “07”, “id”: 1}, {“segmentation”: [[430, 84, 438, 79, 450, 72, 457, 70, 469, 70, 483, 70, 489, 73, 497, 81, 505, 90, 508, 98, 509, 111, 510, 119, 508, 126, 502, 129, 495, 130, 488, 137, 482, 141, 476, 143, 466, 142, 456, 139, 448, 135, 442, 128, 435, 128, 426, 128, 422, 127, 424, 122]], “area”: 6424, “iscrowd”: 0, “image_id”: 1, “bbox”: [422, 70, 88, 73], “category_id”: “08”, “id”: 2}, {“segmentation”: [[511, 115, 521, 115, 532, 115, 539, 119, 547, 128, 551, 140, 552, 150, 549, 160, 546, 172, 540, 182, 532, 189, 526, 191, 521, 193, 516, 194, 512, 194, 509, 191, 498, 175, 495, 174, 490, 169, 489, 162, 483, 154, 480, 149, 480, 146, 483, 142, 496, 131, 503, 129, 509, 126, 511, 119]], “area”: 5688, “iscrowd”: 0, “image_id”: 1, “bbox”: [480, 115, 72, 79], “category_id”: “09”, “id”: 3}, {“segmentation”: [[549, 166, 562, 161, 571, 158, 581, 155, 587, 156, 593, 160, 598, 167, 599, 183, 595, 206, 594, 228, 590, 238, 581, 244, 572, 245, 565, 243, 553, 239, 546, 236, 539, 233, 533, 231, 528, 226, 523, 219, 522, 211, 522, 205, 523, 196, 524, 193, 532, 190, 540, 183, 547, 173]], “area”: 6930, “iscrowd”: 0, “image_id”: 1, “bbox”: [522, 155, 77, 90], “category_id”: “10”, “id”: 4}, {“segmentation”: [[590, 239, 601, 234, 611, 234, 618, 237, 621, 241, 623, 249, 620, 263, 615, 276, 607, 291, 600, 303, 593, 307, 588, 307, 571, 304, 555, 300, 545, 297, 538, 290, 529, 282, 524, 274, 524, 266, 527, 257, 531, 250, 537, 245, 547, 237, 555, 240, 572, 246, 581, 245]], “area”: 7227, “iscrowd”: 0, “image_id”: 1, “bbox”: [524, 234, 99, 73], “category_id”: “11”, “id”: 5}, {“segmentation”: [[605, 296, 614, 294, 622, 290, 628, 288, 634, 288, 640, 291, 645, 295, 647, 303, 646, 317, 639, 333, 620, 340, 577, 346, 572, 347, 565, 341, 556, 338, 553, 333, 552, 328, 553, 319, 558, 311, 564, 303, 582, 307, 588, 308, 594, 307, 601, 304]], “area”: 5605, “iscrowd”: 0, “image_id”: 1, “bbox”: [552, 288, 95, 59], “category_id”: “12”, “id”: 6}, {“segmentation”: [[349, 78, 348, 74, 346, 68, 338, 62, 326, 61, 316, 61, 307, 66, 298, 73, 289, 85, 283, 95, 282, 104, 281, 110, 284, 115, 292, 118, 299, 117, 309, 121, 319, 124, 329, 125, 334, 123, 340, 121, 341, 119, 335, 111, 338, 95, 346, 81]], “area”: 4352, “iscrowd”: 0, “image_id”: 1, “bbox”: [281, 61, 68, 64], “category_id”: “06”, “id”: 7}, {“segmentation”: [[308, 122, 321, 137, 325, 147, 322, 156, 318, 164, 312, 171, 302, 173, 292, 177, 286, 179, 279, 184, 267, 186, 258, 183, 251, 177, 248, 166, 248, 135, 251, 121, 255, 112, 263, 107, 271, 103, 281, 104, 281, 110, 283, 116, 292, 119, 299, 118]], “area”: 6391, “iscrowd”: 0, “image_id”: 1, “bbox”: [248, 103, 77, 83], “category_id”: “05”, “id”: 8}, {“segmentation”: [[279, 184, 287, 180, 296, 185, 297, 187, 297, 198, 297, 211, 290, 221, 281, 232, 271, 235, 266, 233, 257, 232, 250, 232, 245, 233, 241, 233, 236, 229, 226, 227, 218, 225, 211, 221, 208, 215, 207, 207, 208, 186, 211, 174, 216, 161, 218, 155, 223, 150, 228, 153, 248, 167, 250, 178, 257, 183, 267, 186]], “area”: 7650, “iscrowd”: 0, “image_id”: 1, “bbox”: [207, 150, 90, 85], “category_id”: “04”, “id”: 9}, {“segmentation”: [[245, 234, 250, 233, 247, 256, 240, 266, 227, 272, 212, 274, 197, 270, 184, 263, 173, 257, 169, 250, 168, 237, 171, 221, 181, 204, 188, 197, 200, 195, 207, 196, 207, 207, 207, 216, 211, 222, 218, 226, 225, 228, 236, 230, 241, 234]], “area”: 6478, “iscrowd”: 0, “image_id”: 1, “bbox”: [168, 195, 82, 79], “category_id”: “03”, “id”: 10}, {“segmentation”: [[224, 273, 225, 279, 231, 282, 236, 293, 237, 304, 234, 319, 227, 331, 217, 335, 202, 338, 182, 339, 174, 343, 162, 335, 133, 312, 125, 302, 125, 296, 130, 282, 136, 269, 141, 258, 147, 248, 153, 241, 164, 239, 167, 237, 168, 250, 173, 257, 183, 264, 196, 271, 212, 275]], “area”: 11872, “iscrowd”: 0, “image_id”: 1, “bbox”: [125, 237, 112, 106], “category_id”: “02”, “id”: 11}, {“segmentation”: [[380, 483, 382, 480, 383, 474, 384, 466, 384, 461, 378, 452, 375, 447, 372, 441, 367, 432, 363, 424, 358, 416, 354, 413, 352, 410, 347, 409, 342, 410, 336, 413, 331, 417, 325, 422, 318, 428, 309, 436, 304, 442, 300, 448, 298, 452, 297, 455, 297, 465, 297, 473, 300, 479, 304, 483, 306, 487, 312, 489, 329, 491, 354, 492, 366, 492, 373, 491, 377, 488]], “area”: 7221, “iscrowd”: 0, “image_id”: 2, “bbox”: [297, 409, 87, 83], “category_id”: “07”, “id”: 12}, {“segmentation”: [[293, 448, 307, 425, 308, 416, 308, 409, 308, 404, 304, 394, 300, 390, 295, 386, 290, 385, 282, 381, 276, 381, 270, 382, 261, 384, 257, 386, 248, 392, 244, 396, 241, 404, 240, 409, 240, 414, 244, 422, 261, 436, 269, 440, 279, 449, 285, 449]], “area”: 4624, “iscrowd”: 0, “image_id”: 2, “bbox”: [240, 381, 68, 68], “category_id”: “06”, “id”: 13}, {“segmentation”: [[225, 399, 217, 396, 207, 390, 195, 380, 189, 370, 186, 362, 185, 355, 186, 348, 187, 341, 191, 334, 199, 327, 208, 322, 217, 320, 229, 319, 237, 320, 248, 322, 256, 325, 261, 335, 263, 340, 264, 354, 261, 365, 258, 375, 253, 383, 248, 389, 242, 395, 234, 399]], “area”: 6320, “iscrowd”: 0, “image_id”: 2, “bbox”: [185, 319, 79, 80], “category_id”: “05”, “id”: 14}, {“segmentation”: [[169, 249, 177, 247, 187, 247, 199, 248, 209, 249, 217, 251, 223, 254, 228, 258, 232, 265, 233, 270, 234, 280, 231, 289, 229, 295, 220, 302, 214, 308, 207, 314, 197, 319, 189, 321, 183, 321, 174, 320, 170, 319, 162, 313, 157, 310, 152, 305, 148, 297, 146, 286, 147, 276, 148, 263, 157, 256, 163, 252]], “area”: 6512, “iscrowd”: 0, “image_id”: 2, “bbox”: [146, 247, 88, 74], “category_id”: “04”, “id”: 15}, {“segmentation”: [[132, 189, 135, 186, 149, 182, 161, 181, 169, 182, 177, 183, 181, 184, 190, 188, 199, 194, 204, 199, 206, 204, 208, 207, 209, 211, 210, 217, 210, 224, 206, 230, 202, 235, 197, 240, 191, 244, 187, 246, 182, 246, 177, 247, 172, 247, 167, 249, 156, 250, 148, 251, 144, 249, 139, 246, 131, 238, 124, 231, 121, 224, 120, 219, 120, 210, 121, 205, 123, 200, 127, 195]], “area”: 6300, “iscrowd”: 0, “image_id”: 2, “bbox”: [120, 181, 90, 70], “category_id”: “03”, “id”: 16}, …


, {“segmentation”: [[582, 305, 571, 304, 566, 303, 564, 307, 567, 308, 578, 320, 583, 328, 583, 330, 586, 330, 589, 326, 590, 321, 589, 312]], “area”: 702, “iscrowd”: 0, “image_id”: 184, “bbox”: [564, 303, 26, 27], “category_id”: “15”, “id”: 3247}], “categories”: [{“supercategory”: “07”, “id”: “07”, “name”: “07”}, {“supercategory”: “08”, “id”: “08”, “name”: “08”}, {“supercategory”: “09”, “id”: “09”, “name”: “09”}, {“supercategory”: “10”, “id”: “10”, “name”: “10”}, {“supercategory”: “11”, “id”: “11”, “name”: “11”}, {“supercategory”: “12”, “id”: “12”, “name”: “12”}, {“supercategory”: “06”, “id”: “06”, “name”: “06”}, {“supercategory”: “05”, “id”: “05”, “name”: “05”}, {“supercategory”: “04”, “id”: “04”, “name”: “04”}, {“supercategory”: “03”, “id”: “03”, “name”: “03”}, {“supercategory”: “02”, “id”: “02”, “name”: “02”}, {“supercategory”: “07”, “id”: “07”, “name”: “07”}, {“supercategory”: “06”, “id”: “06”, “name”: “06”}, {“supercategory”: “05”, “id”: “05”, “name”: “05”}, {“supercategory”: “04”, “id”: “04”, “name”: “04”}, {“supercategory”: “03”, “id”: “03”, “name”: “03”}, {“supercategory”: “02”, “id”: “02”, “name”: “02”}, {“supercategory”: “01”, …

“id”: “25”, “name”: “25”}, {“supercategory”: “26”, “id”: “26”, “name”: “26”}, {“supercategory”: “27”, “id”: “27”, “name”: “27”}, {“supercategory”: “28”, “id”: “28”, “name”: “28”}, {“supercategory”: “21”, “id”: “21”, “name”: “21”}, {“supercategory”: “20”, “id”: “20”, “name”: “20”}, {“supercategory”: “19”, “id”: “19”, “name”: “19”}, {“supercategory”: “18”, “id”: “18”, “name”: “18”}, {“supercategory”: “17”, “id”: “17”, “name”: “17”}, {“supercategory”: “16”, “id”: “16”, “name”: “16”}, {“supercategory”: “15”, “id”: “15”, “name”: “15”}]}


There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

Did you ever run the mask_rcnn notebook? In the notebook, the dataset_convert will run against the coco2017 dataset.

tao mask_rcnn dataset_convert -i $DATA_DOWNLOAD_DIR/raw-data/train2017 \
                               -a $DATA_DOWNLOAD_DIR/raw-data/annotations/instances_train2017.json \
                               -o $DATA_DOWNLOAD_DIR --include_masks -t train -s 256

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