-
-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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 #1494
Comments
Hello @kongkk233, 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 screenshots and minimum viable code to reproduce your issue, otherwise we can not help you. If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available. For business inquiries or professional support requests please visit https://www.ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com. RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt 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 (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit. |
@kongkk233 hello, thank you for your interest in YOLOv5! This issue seems to lack the minimum requirements for a proper response, or is insufficiently detailed for us to help you. Please note that most technical problems are due to:
$ git clone https://github.com/ultralytics/yolov5 yolov5_new # clone latest
$ cd yolov5_new
$ python detect.py # verify detection
# CODE TO REPRODUCE YOUR ISSUE HERE
If none of these apply to you, we suggest you close this issue and raise a new one using the Bug Report template, providing screenshots and minimum viable code to reproduce your issue. Thank you! RequirementsPython 3.8 or later with all requirements.txt dependencies installed, including $ pip install -r requirements.txt 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 passing. These tests evaluate proper operation of basic YOLOv5 functionality, including training (train.py), testing (test.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu. |
When I train in Colab for a period of time, this error will occur, and it will appear every time I train. The pictures in the dataset are all normal and will not be None. |
@kongkk233 please supply a Colab notebook with a reproducible example. |
@glenn-jocher thanks for your reply
This issue has been mentioned by others I have another question: |
@kongkk233 can provide a reproducible example in a colab notebook, so we can simply click run and see the error? |
@glenn-jocher I have solved this question.I use --cache while training.Thank you very much. |
@kongkk233 that's odd. Do you think it may have to do with the #195 result where the image was a gif? |
@glenn-jocher no.My Image format is png.I think it’s because every epoch needs to re-read the image in Google Drive. Sometimes it will go wrong. |
Oh, then you simply have network issues. You should always train with local data, never with remote buckets/drives. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
You should name this file path using English. |
I also met the same problem. How you solved it? |
Hello, I also encountered the same situation, may I ask how you solved it? Can you provide specific solutions? |
You had to delete the "cache" File in the "data/LSB/labels/xxx.cache"
|
Ways to solve this issue:
|
@PawanKuma hi there, To solve this issue, you can try the following approaches:
These steps should help resolve the "Image Not Found" issue you are facing during training. Let me know if you need any further assistance. Thanks! |
@glenn-jocher (Traceback (most recent call last): Is it because I imported the dataset from my Google Drive? |
@Cho-Hong-Seok hi there! It seems like the issue you're encountering is due to the path to your dataset not being correctly identified by the code. This can occur for a variety of reasons, including incorrect file paths or permission issues accessing Google Drive. While training on Google Colab, remember that your notebook needs permission to access files on Google Drive. Make sure you've mounted your Google Drive correctly and the path you've specified in your training script exactly matches the location of your dataset. Here's a quick snippet to ensure Google Drive is mounted correctly: from google.colab import drive
drive.mount('/content/drive') Verify your dataset path after mounting. For example: !ls /content/drive/MyDrive/[DILab_data]/Computer_Vision/Fire_detection/FST1/FST1/train/images This will list all files in the specified directory, confirming the path is accurate. The comment you've referenced about network issues pertains to physical distance between data and compute resources, which doesn't seem directly related to your current problem. Please check the dataset path and permission settings. Let me know if the issue persists! 😊 |
❔Question
I don't know why some images will be None when load_image().The database is normal.Every time,I train the model,I always encounter this question.
Additional context
File "train.py", line 460, in
train(hyp, opt, device, tb_writer)
File "train.py", line 243, in train
for i, (imgs, targets, paths, _) in pbar: # batch -------------------------------------------------------------
File "/usr/local/lib/python3.6/dist-packages/tqdm/std.py", line 1104, in iter
for obj in iterable:
File "/content/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/utils/datasets.py", line 91, in iter
yield next(self.iterator)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 435, in next
data = self._next_data()
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 1065, in _next_data
return self._process_data(data)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/usr/local/lib/python3.6/dist-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
AssertionError: Caught AssertionError in DataLoader worker process 1.
Original Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/content/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/utils/datasets.py", line 525, in getitem
img, labels = load_mosaic(self, index)
File "/content/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/utils/datasets.py", line 655, in load_mosaic
img, _, (h, w) = load_image(self, index)
File "/content/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/drive/LSB/yolov5-3.1/utils/datasets.py", line 616, in load_image
assert img is not None, 'Image Not Found ' + path
AssertionError: Image Not Found /content/drive/LSB/yolov5-3.1/data/LSB/images/train2020/396.jpg
The text was updated successfully, but these errors were encountered: