TypeError: 'int' object is not iterable when importing YOLO dataset

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Steps to Reproduce

  1. Create a new Prọect in CVAT and go to the project page.
  2. Import a YOLO dataset (images and annotations) via the "Upload Annotations" feature.
  3. Select YOLO Detection 1.0 and dataset in .zip then click OK.
  4. The error occurs.

Expected Behavior

The YOLO dataset should be imported successfully, and the annotations should be visible for editing.

Possible Solution

No response

Context

The dataset structure is as below:

data.yaml
├── train
│   ├── images
│   └── labels
├── valid
│   ├── images
│   └── labels
└── test
    ├── images
    └── labels

Environment

The log detail:


[2025-01-17 10:39:40,125] DEBUG rq.worker: Job import:project-2-dataset raised an exception.
[2025-01-17 10:39:40,129] DEBUG rq.worker: Handling failed execution of job import:project-2-dataset
[2025-01-17 10:39:40,133] DEBUG rq.worker: Handling exception for import:project-2-dataset.
[2025-01-17 10:39:40,134] ERROR rq.worker: [Job import:project-2-dataset]: exception raised while executing (cvat.apps.engine.utils.import_resource_with_clean_up_after)
Traceback (most recent call last):
  File "/opt/venv/lib/python3.10/site-packages/rq/worker.py", line 1431, in perform_job
    rv = job.perform()
  File "/opt/venv/lib/python3.10/site-packages/rq/job.py", line 1280, in perform
    self._result = self._execute()
  File "/opt/venv/lib/python3.10/site-packages/rq/job.py", line 1317, in _execute
    result = self.func(*self.args, **self.kwargs)
  File "/home/django/cvat/apps/engine/utils.py", line 306, in import_resource_with_clean_up_after
    result = func(filename, *args, **kwargs)
  File "/usr/lib/python3.10/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/home/django/cvat/apps/dataset_manager/project.py", line 194, in import_dataset_as_project
    project.import_dataset(f, importer, conv_mask_to_poly=conv_mask_to_poly)
  File "/home/django/cvat/apps/dataset_manager/project.py", line 162, in import_dataset
    importer(dataset_file, temp_dir, project_data, load_data_callback=self.load_dataset_data, **options)
  File "/home/django/cvat/apps/dataset_manager/formats/registry.py", line 36, in __call__
    f_or_cls(*args, **kwargs)
  File "/home/django/cvat/apps/dataset_manager/formats/yolo.py", line 130, in _import_yolo_ultralytics_detection
    _import_common(*args, format_name="yolo_ultralytics_detection", **kwargs)
  File "/home/django/cvat/apps/dataset_manager/formats/yolo.py", line 80, in _import_common
    dataset = Dataset.import_from(temp_dir, format_name,
  File "/opt/venv/lib/python3.10/site-packages/datumaro/components/dataset.py", line 1198, in import_from
    env.make_extractor(src_conf.format, src_conf.url, **extractor_kwargs)
  File "/opt/venv/lib/python3.10/site-packages/datumaro/components/environment.py", line 230, in make_extractor
    return self.extractors.get(name)(*args, **kwargs)
  File "/opt/venv/lib/python3.10/site-packages/datumaro/plugins/data_formats/yolo/base.py", line 363, in __init__
    super().__init__(*args, **kwargs)
  File "/opt/venv/lib/python3.10/site-packages/datumaro/plugins/data_formats/yolo/base.py", line 181, in __init__
    super().__init__(rootpath=osp.dirname(config_path), image_info=image_info, **kwargs)
  File "/opt/venv/lib/python3.10/site-packages/datumaro/plugins/data_formats/yolo/base.py", line 108, in __init__
    subset.items = self._get_lazy_subset_items(subset_name)
  File "/opt/venv/lib/python3.10/site-packages/datumaro/plugins/data_formats/yolo/base.py", line 197, in _get_lazy_subset_items
    return {
  File "/opt/venv/lib/python3.10/site-packages/datumaro/plugins/data_formats/yolo/base.py", line 197, in <dictcomp>
    return {
  File "/opt/venv/lib/python3.10/site-packages/datumaro/plugins/data_formats/yolo/base.py", line 474, in _get_subset_image_paths
    yield from subset_images_source
TypeError: 'int' object is not iterable

[2025-01-17 10:39:40,134] DEBUG rq.worker: Invoking exception handler <function rq_exception_handler at 0x7fb9557e44c0>
[2025-01-17 10:39:40,134] DEBUG rq.worker: Invoking exception handler <function handle_rq_exception at 0x7fb979d95f30>
[2025-01-17 10:39:40,147] DEBUG rq.worker: Sent heartbeat to prevent worker timeout. Next one should arrive in 480 seconds.
[2025-01-17 10:39:40,148] DEBUG rq.worker: Sent heartbeat to prevent worker timeout. Next one should arrive in 480 seconds.
[2025-01-17 10:39:40,149] INFO rq.worker: Cleaning registries for queue: import
[2025-01-17 10:39:40,152] DEBUG rq.worker: *** Listening on import...