-
-
Notifications
You must be signed in to change notification settings - Fork 16.4k
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: Image Not Found ../dataset/images/train/4501.jpeg #195
Comments
@Al-Razi-KR your custom dataset is not correct, you have missing images. |
I just encounter the same problem at just. The image is in the train folder as well. Turns out it is because the origin file is .gif. I changed the format with online converter then everything is fine again. |
Yes, one of my image was in Gif format. Yolov5 only support a few formats which are mentioned in their documentary. Check your image format using PIL. The cause of my issue was I renamed all the images as jpeg without. |
What you mean is that there are pictures in other illegal formats in the data set, not the one that was reported as an error, because the format of the picture that could not be found is correct and it also exists.
…------------------ 原始邮件 ------------------
发件人: "ultralytics/yolov5" <notifications@github.com>;
发送时间: 2021年1月25日(星期一) 晚上6:01
收件人: "ultralytics/yolov5"<yolov5@noreply.github.com>;
抄送: "孙中旭"<2043593085@qq.com>;"Comment"<comment@noreply.github.com>;
主题: Re: [ultralytics/yolov5] AssertionError: Image Not Found ../dataset/images/train/4501.jpeg (#195)
No, I checked all the images are inside.
Hello, did you solve it? I encountered the same problem as you. The picture does exist!
Yes, one of my image was in Gif format. Yolov5 only support a few formats which are mentioned in their documentary. Check your image format using PIL. The cause of my issue was I renamed all the images as jpeg without.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Try:
|
Supported data formats are: Lines 26 to 29 in a41d910
|
Thanks, indeed, it has been resolved! |
Thanks, i got it, it's solved |
@zhongxu-Sun @Al-Razi-KR I was reviewing this. Our intention is to catch corrupted images/labels before training ever starts as part of the label caching process, so I think we may want to add additional checks for this failure mode. The proper workflow is that dataloader checks flag the corrupted image/label and neglect to include it in the training image list, but there would be no errors and training would proceed smoothly (ignoring the corrupted image). |
@zhongxu-Sun @Al-Razi-KR I've opened PR #2042 to fix this issue. This runs an additional check on the actual image format using PIL img.format. For this check to actually run you'd need to delete your existing *.cache files in your dataset directories, which will trigger a new caching. Verified update works correctly. I added a GIF to COCO128 and renamed it with a .jpg extension. The new check caught the file, removed it from the training images, and then trains correctly. |
Hi, I am having trouble with this! It works in Google colab but I am trying to run it in Ubuntu using my university's servers, but for some reason it's not working. I am getting: AssertionError: Image Not Found ../train/images/0006476c7a10ac38_jpg.rf.d0903a65b762f4a64848d7f12956628f.jpg But when I go into a Jupyter notebook (using the university's servers) and do: import cv2 The answer is an array of colour values, and not None. How can I resolve this? I have opencv-contrib-python version 4.5.2.54. |
@julian-douglas your image is not found. See Train Custom Data tutorial to get started: YOLOv5 Tutorials
|
Hi Glenn, Thanks for the swift reply. I followed the Roboflow tutorial and exported my dataset (70,000 images) into the YOLOv5 format, e.g. 40 0.5036057692307693 0.5048076923076923 0.47596153846153844 0.4411057692307692. The thing is, they sorted it into three directories: train, valid and test. In the 'Train Custom Data' section you just posted I see only dataset/images/im0.jpg. How does it know the train/valid/test ratio? I am also a bit confused by section 3 of 'Train Custom Data'.. it says that /coco128 is assumed to be next to /yolov5; is that a requirement? I am using an external server and I don't think I can move files within the directory to be next to each other using Ubuntu. Is there a way to specify the directory of the training images? |
@julian-douglas you can put your dataset anywhere you want and split it anyway you want. See other datasets for example splits, i.e. VOC: Lines 9 to 20 in c6c88dc
|
So why is it able to find the images first? It scans all of the images correctly (final output was train: Scanning ' /homes/jd2334/trainYOLO/labels' for images and labels... 58069 found) and then fails the assert image is not None. The beginning of my data.yaml file looks like this: And the command that I am running is: |
@julian-douglas these two lines load an image and verify the result. If the result is None this typically indicates that cv2.imread() did not find the path successfully. Lines 604 to 605 in c6c88dc
|
I know what you mean. You can try to delete it directly in the dataset file. This image may be a problem image. Last time, I directly deleted those two problem pictures to solve them.Hope it works for you.
…------------------ 原始邮件 ------------------
发件人: "ultralytics/yolov5" ***@***.***>;
发送时间: 2021年7月2日(星期五) 上午7:09
***@***.***>;
***@***.******@***.***>;
主题: Re: [ultralytics/yolov5] AssertionError: Image Not Found ../dataset/images/train/4501.jpeg (#195)
@julian-douglas these two lines load an image and verify the result. If the result is None this typically indicates that cv2.imread() did not find the path successfully.
https://github.com/ultralytics/yolov5/blob/c6c88dc601fbdbe4e3391ba14245ec2740b5d01a/utils/datasets.py#L604-L605
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@glenn-jocher |
Error. Image not found with id: train_32 |
@Viper7-adking 你好!通常这个错误 |
谢谢!但是为什么我训练好的模型的map里会多一个face,相对应的txt里只有nomask 和mask两个标签 |
@Viper7-adking 你好,生成的 map 文件如果包含了在标签里没有的类别(face),可能是你的标签文件有误,也有可能是在训练网络时使用了错误的权重文件,以至于网络在输出时产生了错误预测。建议你检查一下标签文件和使用的权重文件,确保文件没有错误。如果仍然无法解决问题,可以考虑重新收集数据,重新训练新的模型。 |
非常感谢 |
@Viper7-adking 不客气!如有其他问题,欢迎继续提问,祝您好运! |
Input:
Output:
The text was updated successfully, but these errors were encountered: