Error training with Roboflow: No labels found in cache

We’re attempting to train a model with Roboflow. We can export and train with yolov8 without issue. After training for over an hour, we got this error:

e[34me[1mval: e[0mNo labels found in /tmp/cache/dataset/test/labels.cache, can not start training. See
Traceback (most recent call last):
  File "/app/", line 11, in <module>
  File "/usr/lib/python3.8/", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/", line 87, in _run_code
    exec(code, run_globals)
  File "/app/", line 10, in <module>
  File "/app/", line 6, in main
  File "/app/src/", line 34, in monitored_train
    raise self.exc
  File "/app/src/", line 40, in monitor_train
  File "/app/src/yolov8/", line 305, in train
    _, test_class_map = self.get_class_map("test", self.model)
  File "/app/src/yolov8/", line 208, in get_class_map
  File "/usr/local/lib/python3.8/dist-packages/torch/autograd/", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/engine/", line 137, in __call__
    self.dataloader = self.dataloader or self.get_dataloader(, self.args.batch)
  File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/v8/detect/", line 208, in get_dataloader
    dataset = self.build_dataset(dataset_path, batch=batch_size, mode='val')
  File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/v8/detect/", line 186, in build_dataset
    return build_yolo_dataset(self.args, img_path, batch,, mode=mode, stride=gs)
  File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/", line 74, in build_yolo_dataset
    return YOLODataset(
  File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/", line 39, in __init__
    super().__init__(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/", line 72, in __init__
    self.labels = self.get_labels()
  File "/usr/local/lib/python3.8/dist-packages/ultralytics/yolo/data/", line 123, in get_labels
    raise FileNotFoundError(f'{self.prefix}No labels found in {cache_path}, can not start training. {HELP_URL}')
FileNotFoundError: e[34me[1mval: e[0mNo labels found in /tmp/cache/dataset/test/labels.cache, can not start training. See

Any idea why this might be happening? Thanks!

The error message you’re seeing indicates that the training process is unable to find the labels for your test dataset. This could be due to a few reasons:

  1. Incorrect Dataset Structure: The structure of your dataset might not be as expected. The expected structure when running !python should be as follows:
├── yolov8
└── datasets
    └── roboflow
        ├── test
        ├── train
        └── valid
            ├── images
            ├── labelTxt

Make sure your dataset structure matches this. The dataset name should be roboflow to prevent any errors from triggering (source).

  1. Incorrect File Extensions: The error message also mentions that the supported extensions for the class labels are: .jpg, .jpeg, .png, .ppm, .bmp, .pgm, .tif, .tiff, .webp. Make sure your label files have one of these extensions (source).

  2. Incorrect data.yaml File: The data.yaml file might not be correctly specifying the locations of your dataset files. Make sure this file is correctly set up (source).

If you’ve checked all of these and are still encountering the issue, it might be helpful to provide more information about your setup or reach out to Roboflow’s support for more specific assistance.

Hi! I’m Roboflow’s AI powered bot. This is an automated response powered using AI with knowledge from our docs, blog, knowledge base, and previous forum responses. If you find this to be a helpful answer, please mark it as the solution using the checkbox icon below. If this doesn’t solve your issue, please follow up with what you’ve tried/why, and the community will continue to chime in as usual.