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
IndexError: index 1 is out of bounds for dimension 1 with size 1 #472
Comments
@ElMahdiAboulmanadel thanks for the bug report! Can you provide your dataset to help us reproduce? Your command works correctly with COCO128 so at the moment it is not possible for us to debug this. |
Hello @glenn-jocher , thanks for the quick reply! here is the dataset I'm using : https://drive.google.com/drive/folders/1SiUKC1mtuT88E5OIIkaH4mqOPhH39iJz?usp=share_link , I was trying Ultralytics HUB but it didn't work (Dataset processing error). |
If ultralytics HUB didn't work, there's probably something wrong with your dataset. Can you paste the error you're getting on hub? |
I made a new dataset and I think it'll work this time, I uploaded it to Ultalytics HUB and it didn't give me the processing error this time, it's still Transferring... Can you please explain to me the issue? I actually have a dataset of images of one leaf, each image has one leaf of a specific plant with a specific disease so you'll find that my labels bboxes are all the same : 1 0.5 0.5 0.9 0.9, only the class ID is changing. Does the issue relate to my approach of having one bbox per image? |
When it finished processing the dataset, I clicked on train model then went to Google Colab. When I launch the second code cell, it starts then crashes. A popup appears in the left bottom area saying 'Your session crashed. Automatically restarting.' I tried multiple times but I get the same issue and here is the results :
|
@ElMahdiAboulmanadel i was also facing same issue while doing validation . issue is solved , just by providing validation dataset. |
I'm having the same error with a single-class object detection problem. I'm aiming to detect defects (not classified) in some metal parts. Here's my dataset (based on CSIM-MISD dataset), together with the data.yaml file: https://drive.google.com/drive/folders/1kI-lCv8nv2jNqy1O6PnandzhRZSA-APO?usp=sharing. |
👋 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 ⭐ |
Same issue
|
@yrik hello! Thank you for reaching out regarding this error. In order to resolve this issue, it's important to provide a validation dataset in addition to the train dataset. You can do this by providing the path to your validation dataset when running the YOLOv8 training command using the |
@glenn-jocher thank you for the reply! In my case, the issue was simpler. I had index 1 (instead of 0) in my txt files that describe labels and in my data.yaml file I had just one class. So to fix it I just added a dummy extra class to the data.yaml and all is good now. |
I also encountered this issue. After investigating, I found that the mismatch between the IDs in the labels and the number of classes (nc) in the config file was the cause. For example, if you have IDs 0 and 1 in the labels but set nc=1 in the config, you will encounter this error. Correctly setting the class information in the config can avoid this issue. I hope this helps you. |
@FreeSoaring hello and thank you for your contribution! Your finding about the mismatch between the IDs in the labels and the classes in the config file is a valuable catch indeed - it could very well be the root of the issue that some are encountering. It's crucial that the class IDs in the label files align with the 'nc' (number of classes) mentioned in the dataset configuration. If you have labels for classes 0 and 1, but you've set 'nc' as 1 in the config file, the model could potentially struggle with identifying and categorizing the objects correctly which may result in errors. Ensuring that the number of classes in the config file aligns with the highest class ID in the label files would be key to avoiding this kind of issue. Keep exploring and debugging, your insights are very helpful for us and the wider community! |
Hello I am working in an object detection project in a company while training the model I encountered this error: My dataset is about more than 400+ images. I annotated it all manually! Can anyone of you guys can help me to resolve the issue? Hoping for a quick reply !😅 |
@Rilesyt it appears you're encountering an index error during training, which suggests there might be an issue with the dataset or the model's interpretation of the dataset. Here are a few steps you can take to troubleshoot the problem:
Remember, the YOLOv8 community and the Ultralytics team are here to help! 🚀 |
Search before asking
YOLOv8 Component
Training
Bug
I'm using this command to train YOLO v8 on Plant Village Dataset, I've prepared the dataset in YOLO Format as described in the tutorials :
yolo task=detect mode=train model=yolov8n.pt data=plantvillage.yaml epochs=3 imgsz=256
When I run the command, I get this error :
Environment
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: