Yolo V8 error: "FileNotFoundError: Found no valid file for the classes labels" solution

Screenshot 2023-08-20 at 9.04.22 PM
This is what your folder hierarchy needs to look like when training an object detection model with yolo V8.

I was getting this error “FileNotFoundError: Found no valid file for the classes labels. Supported extensions are: .jpg, .jpeg, .png, .ppm, .bmp, .pgm, .tif, .tiff, .webp”

Because by default roboflow does not export the files in the correct way.

Thought this might help someone.

Hi @Boaztheostrich

Can you share where you got this error? (the Ultralytics package, our YOLOv8 notebook, etc)

Our YOLOv8 export format should look like this, but it could differ as long as it’s specified in the data.yaml file correctly:
Screenshot 2023-08-24 at 2.13.26 PM

If I see it happen again i will try to share it with you I think my data.yaml file got messed up

i got the same problem, why robolow not provided it(data.yaml)?

have you solved it sir?

Hey @NORSYADIYAH_NORAZLI

Could you explain what you mean? It’s not clear to me what the problem is here.

It seems to me like you are saying that you have an issue with the data.yaml file not present, but also say that you have the same issue as the original post where the user had a screenshot of the folders, where a data.yaml file is present.

Could you share 1) what format you are exporting in, 2) any error messages you may have received and 3) any relevant code or screenshots to understand your problem further

The problem is the format of the dataset.

From ultralytics they say the dataset structure should look like this

cifar-10-/
|
|-- train/
|   |-- airplane/
|   |   |-- 10008_airplane.png
|   |   |-- 10009_airplane.png
|   |-- automobile/
|   |   |-- 10010_automobile.png
|   |   |-- 10011_automobile.png
|
|-- test/
|   |-- airplane/
|   |   |-- 20008_airplane.png
|   |   |-- 20009_airplane.png
|   |-- automobile/
|   |   |-- 20010_automobile.png
|   |   |-- 20011_automobile.png
|
|-- val/ (optional)
|   |-- airplane/
|   |   |-- 30008_airplane.png
|   |   |-- 30009_airplane.png
|   |-- automobile/
|   |   |-- 30010_automobile.png
|   |   |-- 30011_automobile.png

I faced the same issue ,to solve this problem Make sure you are exporting the dataset with YOLOv5-pytorch format then go to the dataset folder

open the data.yaml
modify the path for all train t,est and val like this
Capture1

Could you share a google colab or .ipynb with an example because i can’t make it run even after applying your fix.