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

Assertion Error : Image not found #12865

Closed
1 task done
Cho-Hong-Seok opened this issue Apr 1, 2024 · 5 comments
Closed
1 task done

Assertion Error : Image not found #12865

Cho-Hong-Seok opened this issue Apr 1, 2024 · 5 comments
Labels
question Further information is requested Stale

Comments

@Cho-Hong-Seok
Copy link

Cho-Hong-Seok commented Apr 1, 2024

Search before asking

Question

I am currently trying to train a yolov6 model in google colab and I am getting error.

I referenced the question below.
(#1494)

Is it because I imported the dataset from my Google Drive?
And if that's the case, is what you're saying above referring to my situation?(glenn-jocher commented on Nov 27, 2020
Oh, then you simply have network issues. You should always train with local data, never with remote buckets/drives.)

yolov6 error
yolov6 error1

Additional

(Traceback (most recent call last):
File "/content/YOLOv6/tools/train.py", line 142, in .
main(args)
File "/content/YOLOv6/tools/train.py", line 127, in main
trainer = Trainer(args, cfg, device)
File "/content/YOLOv6/yolov6/core/engine.py", line 94, in init
self.train_loader, self.val_loader = self.get_data_loader(self.args, self.cfg, self.data_dict)
File "/content/YOLOv6/yolov6/core/engine.py", line 406, in get_data_loader
train_loader = create_dataloader(train_path, args.img_size, args.batch_size // args.world_size, grid_size,
File "/content/YOLOv6/yolov6/data/data_load.py", line 46, in create_dataloader
dataset = TrainValDataset(
File "/content/YOLOv6/yolov6/data/seg_datasets.py", line 86, in init
self.img_paths, self.labels = self.get_imgs_labels(self.img_dir)
File "/content/YOLOv6/yolov6/data/seg_datasets.py", line 329, in get_imgs_labels
assert img_paths, f"No images found in {img_dir}."
AssertionError: No images found in /content/drive/MyDrive/[DILab_data]/Computer_Vision/Fire_detection/FST1/FST1/train/images.)

@Cho-Hong-Seok Cho-Hong-Seok added the question Further information is requested label Apr 1, 2024
Copy link
Contributor

github-actions bot commented Apr 1, 2024

👋 Hello @Cho-Hong-Seok, 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.

Requirements

Python>=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

Environments

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

Status

YOLOv5 CI

If 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

@glenn-jocher
Copy link
Member

@Cho-Hong-Seok hey there! It seems like your issue might stem from the path to your dataset not being correctly resolved in Google Colab. This error typically occurs when the model cannot locate the images at the specified path, which could indeed happen if there's a mismatch in the path or if the dataset isn't properly mounted from Google Drive.

To troubleshoot, please ensure:

  1. Your Google Drive is properly mounted in Colab.
  2. The dataset path you're providing matches exactly with the location of your images in the Drive. Double-check for any typos or incorrect folder names.
  3. You might also try printing out the path to verify it's accessible from your Colab environment.

Quick snippet to check your path:

import os

path = '/content/drive/MyDrive/[DILab_data]/Computer_Vision/Fire_detection/FST1/FST1/train/images'
print(os.path.exists(path))  # This should print True if the path is correct

If these steps don't resolve the issue, you might consider copying the dataset to Colab's local environment to see if that works better for you. Remote datasets can sometimes cause issues, especially with network latency or path resolution.

Let us know how it goes! 😊

Copy link
Contributor

github-actions bot commented May 2, 2024

👋 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 May 2, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 12, 2024
@yumiao123456
Copy link

your file seems to be broken, check if you can open it throught cv

@glenn-jocher
Copy link
Member

@yumiao123456 hello! It sounds like there might be an issue with the integrity of your image files. I recommend trying to open your images using OpenCV to verify they are not corrupted. Here’s a quick way to test an image:

import cv2

# Replace 'path_to_your_image' with the path to your image file
image = cv2.imread('path_to_your_image')
if image is None:
    print("Image not loaded properly.")
else:
    print("Image loaded successfully.")

If the image doesn't load properly, you might need to check the source of your images or ensure they are correctly transferred or downloaded. Let us know how it goes!

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