-
-
Notifications
You must be signed in to change notification settings - Fork 16.6k
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
AssertionError: train: No labels found in /content/drive/MyDrive/Colab/Fishai-10/train/labels.cache, can not start training. #12548
Comments
👋 Hello @lpkpaco, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution. 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. RequirementsPython>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started: git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install EnvironmentsYOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit. Introducing YOLOv8 🚀We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀! Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects. Check out our YOLOv8 Docs for details and get started with: pip install ultralytics |
@lpkpaco hey there! It seems like the training process is unable to find any labels in the specified location. Here's what you can do to troubleshoot. First, ensure that your label files are correctly located in the Next, check that the label files are in the correct format and contain the expected annotations. Finally, make sure that the path to the label files is correctly specified in the data.yaml file. Let me know if you need more help with this! |
I think it is correct. And here is the labels.cache file (I couldn't drop it here in GitHub as the file type is not supported): I don't know what's going wrong. |
@lpkpaco your data.yaml configuration looks good. The label files and images are also in the correct format. However, I noticed that your labels are in ".txt" format, whereas the error message references "labels.cache". YOLOv5 expects labels to be in the COCO JSON format or YOLO txt format. Therefore, you might want to check the label caching process in your training pipeline. Let me know if you need further assistance! |
👋 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 ⭐ |
I found a solution but I don't know if it would work next time. |
@lpkpaco I'm glad to hear you found a workaround by adjusting the data processing steps in Roboflow. It's possible that an issue during the preprocessing or augmentation stages could have affected the label files or their paths. For future reference, if you encounter similar issues, consider verifying each step of the data preparation process to ensure consistency and correctness of the data format before training. If you have any more questions or run into any other issues, feel free to reach out. Happy training! 🚀 |
I couldn’t locate why did that issue happen, probably has something to do with Colab and my Roboflow exporting process. My suggestion is: you can try yolov8 if using yolov5 is not a requirement for your project. I switched to yolov8 and such problems did not happen again. The support for v8 is also better. |
Thx for the advice I was using Yolov11 originally. Just switched yolov8 and still got the same problem. |
If you're encountering the same issue with YOLOv8 after switching, the problem may lie in your dataset structure or export process. Double-check your dataset paths in the |
My folder structure is the following. Could the problem be that I have more folders within the Images and Labels folder and that where my images and labels are stored? |
@GreaterthanGreat yes, the issue could be due to having subfolders within the |
Search before asking
Question
I am currently using Google Colab and Roboflow to generate and train my dataset. However, I get this error message everytime when I start training.
I have looked up for solutions, like using !chmod to grant access, maintaining the directory structure etc. These methods did not work.
What should I do?
Here is the code that I used:
!chmod +w /content/drive/MyDrive/Colab/Fishai-10/train/labels !chmod +w /content/drive/MyDrive/Colab/Fishai-10/valid/labels !python /content/drive/MyDrive/Colab/yolov5/train.py --batch 100 --epochs 2000 --img 640 --data '/content/drive/MyDrive/Colab/Fishai-10/data.yaml' --weights yolov5s.pt --patience 100 from google.colab import runtime runtime.unassign()
And I get:
error_message.txt
Additional
No response
The text was updated successfully, but these errors were encountered: