yolov5 icon indicating copy to clipboard operation
yolov5 copied to clipboard

Assertion Error : Image not found

Open Cho-Hong-Seok opened this issue 1 year ago β€’ 3 comments

Search before asking

  • [X] I have searched the YOLOv5 issues and discussions and found no similar questions.

Question

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

I referenced the question below. (https://github.com/ultralytics/yolov5/issues/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 avatar Apr 01 '24 08:04 Cho-Hong-Seok

πŸ‘‹ 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

github-actions[bot] avatar Apr 01 '24 08:04 github-actions[bot]

@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! 😊

glenn-jocher avatar Apr 01 '24 11:04 glenn-jocher

πŸ‘‹ 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:

  • Docs: https://docs.ultralytics.com
  • HUB: https://hub.ultralytics.com
  • Community: https://community.ultralytics.com

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[bot] avatar May 02 '24 00:05 github-actions[bot]

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

yumiao123456 avatar Jun 06 '24 10:06 yumiao123456

@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!

glenn-jocher avatar Jun 06 '24 14:06 glenn-jocher