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

**URL:** <https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969>\
**Category:** 🛠️ Feature Reqs\
**Created:** [August 21, 2023, 2:06am UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969 "2023-08-21T02:06:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boaztheostrich](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/boaztheostrich/32/2664_2.png) [@Boaztheostrich](https://discuss.roboflow.com/u/Boaztheostrich)\
**Post date:** [August 21, 2023, 2:06am UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/1 "2023-08-21T02:06:22Z")

</div>

![Screenshot 2023-08-20 at 9.04.22 PM](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/3/314c2f427c7d95ebc71d65777c5a9777e49473e3.jpeg)  
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.

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [August 24, 2023, 5:18am UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/2 "2023-08-24T05:18:00Z")

</div>

Hi @Boaztheostrich

Can you share where you got this error? (the Ultralytics package, [our YOLOv8 notebook](https://github.com/roboflow/notebooks), 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](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/c/ce30b2e798182947466c013f1183d4a1232bd53d.png)

---

<div class="post-metadata">

**Author:** ![Boaztheostrich](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/boaztheostrich/32/2664_2.png) [@Boaztheostrich](https://discuss.roboflow.com/u/Boaztheostrich)\
**Post date:** [August 30, 2023, 2:09am UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/3 "2023-08-30T02:09:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NORSYADIYAH\_NORAZLI](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/norsyadiyah_norazli/32/3197_2.png) [@NORSYADIYAH\_NORAZLI](https://discuss.roboflow.com/u/NORSYADIYAH_NORAZLI)\
**Post date:** [April 21, 2024, 4:58am UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/4 "2024-04-21T04:58:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![NORSYADIYAH\_NORAZLI](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/norsyadiyah_norazli/32/3197_2.png) [@NORSYADIYAH\_NORAZLI](https://discuss.roboflow.com/u/NORSYADIYAH_NORAZLI)\
**Post date:** [April 21, 2024, 4:58am UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/5 "2024-04-21T04:58:33Z")

</div>

have you solved it sir?

---

<div class="post-metadata">

**Author:** ![leo](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/leo/32/2228_2.png) [@leo](https://discuss.roboflow.com/u/leo)\
**Post date:** [April 21, 2024, 8:51pm UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/6 "2024-04-21T20:51:56Z")

</div>

Hey @NORSYADIYAH_NORAZLI

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

> [@NORSYADIYAH\_NORAZLI](#):
>
> i got the same problem, why robolow not provided it(data.yaml)?

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

---

<div class="post-metadata">

**Author:** ![Bwaki](https://avatars.discourse-cdn.com/v4/letter/b/a6a055/32.png) [@Bwaki](https://discuss.roboflow.com/u/Bwaki)\
**Post date:** [May 8, 2024, 10:53pm UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/7 "2024-05-08T22:53:37Z")

</div>

The problem is the format of the dataset.

From ultralytics they say the dataset structure should look like this

```auto
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

```

> **[Image Classification Datasets Overview](https://docs.ultralytics.com/datasets/classify/#adding-your-own-dataset)**
>
> Explore image classification datasets supported by Ultralytics, learn the standard dataset format, and set up your own dataset for training models.

---

<div class="post-metadata">

**Author:** ![MOHAMAD\_ALFNISH](https://yyz1.discourse-cdn.com/flex029/user_avatar/discuss.roboflow.com/mohamad_alfnish/32/3827_2.png) [@MOHAMAD\_ALFNISH](https://discuss.roboflow.com/u/MOHAMAD_ALFNISH)\
**Post date:** [May 15, 2024, 5:38am UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/8 "2024-05-15T05:38:15Z")

</div>

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](https://canada1.discourse-cdn.com/flex029/uploads/roboflow1/original/2X/5/512867a972a92baf0d39800663cfaf52e267f8c9.png)

---

<div class="post-metadata">

**Author:** ![Bwaki](https://avatars.discourse-cdn.com/v4/letter/b/a6a055/32.png) [@Bwaki](https://discuss.roboflow.com/u/Bwaki)\
**Post date:** [May 23, 2024, 10:20pm UTC](https://discuss.roboflow.com/t/yolo-v8-error-filenotfounderror-found-no-valid-file-for-the-classes-labels-solution/2969/9 "2024-05-23T22:20:54Z")

</div>

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