Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep geting "FileNotFoundError: val: No labels found in C:\[...]\lisa-dataset\valid\labels.cache, can not start training" #1770

Closed
1 task done
KuroiYoshiko opened this issue Apr 2, 2023 · 6 comments
Labels
question Further information is requested Stale

Comments

@KuroiYoshiko
Copy link

Search before asking

Question

I know someone had similar problem already but for me it seems a bit different, as it seems to be only about these labels.cache files. I converted LISA traffic dataset to, what I at least think is appropriate version, to be able to train yolov8 with it.
I'm getting this specific error:
FileNotFoundError: val: No labels found in C:\Users\rumpe\OneDrive\Desktop\lisa-test\datasets\lisa-dataset\valid\labels.cache, can not start training. See https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data

Picture of entire terminal:
image

I converted LISA dataset to format as below, splitting folders for "train" and "valid", and in both there's "images" and "labels" folders. In main folder (lisa-dataset, consisting of train and valid folders) I have data.yaml file that looks like below:
image
image

This format worked when I was training model in google colab. After splitting dataset into smaller sample I was able to both train model and use detection, so I'm convinced it's correct. I just didn't have labels.cache but seems not to be problem for colab. As you can see in colab training starts without problem, it just creates appropriate labels.cache files that seem to work:
image

But suddenly when I want to do the same thing on my desktop with windows 10, in virtual environment it doesn't seem to work, giving me error that I stated before. It also creates cache files but as I understand they are not correct?
image

I'm totally lost as what should I do and what could be the problem in this situation. Funny enough, on the second PC I own (just has worse specs so I wanted to switch to something better for training) I had the same problem, took me 3 hours to fix it and I don't even recall what could that be, as I literally tried everything before it finally worked (from changing hierarchy of folders multiple times, restarting pc, installing and uninstalling packages of cuda-python, torch and who knows what else...). Hierarchy of folders on both PC seem to be the same... Any idea what could I do to fix this?

Additional

No response

@KuroiYoshiko KuroiYoshiko added the question Further information is requested label Apr 2, 2023
@github-actions
Copy link

github-actions bot commented Apr 2, 2023

👋 Hello @KuroiYoshiko, thank you for your interest in YOLOv8 🚀! We recommend a visit to the YOLOv8 Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Install

Pip install the ultralytics package including all requirements in a Python>=3.7 environment with PyTorch>=1.7.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

@github-actions
Copy link

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale label Jun 26, 2023
@mausam-office
Copy link

I got same error while training yolov8-pose model
"FileNotFoundError: val: No labels found in D:\Mausam\YOLOv8\PlateRecognition\datasets\projects\plateDetectionKeypoint\V1 data2\labels\val.cache,"

Were you able to solve the issue? @KuroiYoshiko @glenn-jocher

Following code is of data-config.yaml file
image

ERROR
image

Please let me know if there is any issue with yaml file

@mausam-office
Copy link

I was able to solve the above problem.
The problem existed with my data. The label file for image file was with different name which created no label file for image file

This problem will arise if no label file is available for any of the images in either of directories: train or val.

@github-actions github-actions bot removed the Stale label Jul 1, 2023
@glenn-jocher
Copy link
Member

@mausam-office i'm glad to hear that you were able to solve the issue! It seems like the problem was with your data. Specifically, the label file for an image file had a different name, which caused the absence of a label file for that image file.

This issue can occur when there are no label files available for any of the images in either the "train" or "val" directories.

By ensuring that the label file names match the corresponding image file names, you can avoid this error and proceed with training your YOLOv8 model.

If you have any further questions or concerns, feel free to ask. Good luck with your training!

@github-actions
Copy link

github-actions bot commented Aug 1, 2023

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐

@github-actions github-actions bot added the Stale label Aug 1, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested Stale
Projects
None yet
Development

No branches or pull requests

3 participants