Error when fetching dataset_convert spec schema (COCO object detection) (original) (raw)

I’ve uploaded a COCO object detection dataset successfully to my TAO API endpoint. dataset_convert fails, though.

If using the notebook:

Trying to fetch default convert spec schema from the following endpoint:

{base_url}/datasets/{dataset_id}/specs/convert/schema"

I see a 500 error, and the following in kubectl logs:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/api/specs_utils/specs/object_detection/object_detection - convert__coco.csv'

Full stack trace:

[2025-03-08 01:53:16,713] ERROR in app: Exception on /api/v1/users/b835bea2-c296-5e58-8958-5995ae3c3a3a/datasets/116c27a0-b10e-435e-975c-e8eab96b1910/specs/convert/schema [GET]
Traceback (most recent call last):
  File "/venv/lib/python3.11/site-packages/flask/app.py", line 2190, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/flask/app.py", line 1486, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/api/app.py", line 85, in decorated_function
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/api/app.py", line 1277, in dataset_specs_schema
    response = app_handler.get_spec_schema(user_id, dataset_id, action, "dataset")
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/api/handlers/app_handler.py", line 566, in get_spec_schema
    json_schema = csv_to_json_schema.convert(CSV_PATH, inferred_class_names)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/api/specs_utils/csv_to_json_schema.py", line 132, in convert
    with open(path, mode='r', encoding='utf-8-sig') as f:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/opt/api/specs_utils/specs/object_detection/object_detection - convert__coco.csv'
10.150.3.49 - - [08/Mar/2025:01:53:16 +0000] "GET /api/v1/users/b835bea2-c296-5e58-8958-5995ae3c3a3a/datasets/116c27a0-b10e-435e-975c-e8eab96b1910/specs/convert/schema HTTP/1.1" 500 415 "-" "python-requests/2.32.3"

Previously I’ve converted the following dataset types successfully in TAO:

Is there an issue with COCO + object detection specifically?

Morganh March 8, 2025, 8:48am 2

Could you run default notebook successfully?

Yes - what I meant is that I took code from the YOLOv4 object detection notebook and modified it to do object detection + COCO, and that’s when I encountered the error.

Morganh March 8, 2025, 9:13am 4

I am afraid it is not supported because in the notebook, it says,

if model_name in ("efficientdet_tf1", "efficientdet_tf2", "deformable_detr", "dino"):
    ds_format = "coco"

Understood, thank you @Morganh .

Just to clarify – Does this mean that COCO is only supported for segmentation tasks in TAO API, then? I understand that COCO bounding boxes are a quite common format for object detection models as well in the computer vision world, so was hoping there would be COCO support for some of the object detection models.

Is there sample code I may use to simply test uploading/converting a COCO bounding box dataset into TAO API, to ensure my dataset has the correct label format, dir structure, etc ?

Morganh March 10, 2025, 2:28am 6

No, it means the coco format is supported by default during these network(“efficientdet_tf1”, “efficientdet_tf2”, “deformable_detr”, “dino”).

You can try to search in the network and find coco2kitty.py to convert your dataset to KITTI format.

yingliu April 14, 2025, 10:51am 7

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

system Closed April 28, 2025, 10:51am 8

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