Open nateeinit opened 3 years ago
assert img is not None
means your datalodaer did not get your input data, please check carefully.
Had this problem and it was solved by changing the path to the folder where my images actually are, in my case I made the change on coco.py inside YOLOX/yolox/data/datasets/, for VOC dataset I guess you have to edit the path in voc.py..
I train coco2017. and meet the same problem
Had this problem and it was solved by changing the path to the folder where my images actually are, in my case I made the change on coco.py inside YOLOX/yolox/data/datasets/, for VOC dataset I guess you have to edit the path in voc.py..
I met the same problem on my custom dataset in COCO format. Could you explain your solution in more detail?Thx!
I had the same problem on VOC dataset. Could you explain how to do?
look your format of data, such as png or jpg?
I had the same problem on COCO dataset ,How to solved this question?
File "tools/train.py", line 132, in
args=(exp, args),
│ └ Namespace(batch_size=16, cache=False, ckpt='weights/yolox_nano.pth', devices=1, dist_backend='nccl', dist_url=None, exp_file=...
└ ╒══════════════════╤═════════════════════════════════════════════════════════════════════════════════════════════════════════...
File "tools/train.py", line 110, in main trainer.train() │ └ <function Trainer.train at 0x7fd64181a158> └ <yolox.core.trainer.Trainer object at 0x7fd6415b3da0>
File "/root/YOLOX/yolox/core/trainer.py", line 70, in train self.before_train() │ └ <function Trainer.before_train at 0x7fd64158cf28> └ <yolox.core.trainer.Trainer object at 0x7fd6415b3da0>
File "/root/YOLOX/yolox/core/trainer.py", line 152, in before_train self.prefetcher = DataPrefetcher(self.train_loader) │ │ │ └ <yolox.data.dataloading.DataLoader object at 0x7fd63321de10> │ │ └ <yolox.core.trainer.Trainer object at 0x7fd6415b3da0> │ └ <class 'yolox.data.data_prefetcher.DataPrefetcher'> └ <yolox.core.trainer.Trainer object at 0x7fd6415b3da0>
File "/root/YOLOX/yolox/data/data_prefetcher.py", line 21, in init self.preload() │ └ <function DataPrefetcher.preload at 0x7fd641880620> └ <yolox.data.data_prefetcher.DataPrefetcher object at 0x7fd64f9ebcf8>
File "/root/YOLOX/yolox/data/data_prefetcher.py", line 25, in preload self.next_input, self.nexttarget, , _ = next(self.loader) │ │ │ └ <torch.utils.data.dataloader._MultiProcessingDataLoaderIter object at 0x7fd64f973198> │ │ └ <yolox.data.data_prefetcher.DataPrefetcher object at 0x7fd64f9ebcf8> │ └ <yolox.data.data_prefetcher.DataPrefetcher object at 0x7fd64f9ebcf8> └ <yolox.data.data_prefetcher.DataPrefetcher object at 0x7fd64f9ebcf8>
File "/root/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 521, in next data = self._next_data() │ └ <function _MultiProcessingDataLoaderIter._next_data at 0x7fd64f9af730> └ <torch.utils.data.dataloader._MultiProcessingDataLoaderIter object at 0x7fd64f973198> File "/root/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data return self._process_data(data) │ │ └ <torch._utils.ExceptionWrapper object at 0x7fd632f4e748> │ └ <function _MultiProcessingDataLoaderIter._process_data at 0x7fd64f9af840> └ <torch.utils.data.dataloader._MultiProcessingDataLoaderIter object at 0x7fd64f973198> File "/root/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data data.reraise() │ └ <function ExceptionWrapper.reraise at 0x7fd6e974c7b8> └ <torch._utils.ExceptionWrapper object at 0x7fd632f4e748> File "/root/anaconda3/envs/py36/lib/python3.6/site-packages/torch/_utils.py", line 425, in reraise raise self.exc_type(msg) │ │ └ 'Caught AssertionError in DataLoader worker process 0.\nOriginal Traceback (most recent call last):\n File "/root/anaconda3/... │ └ <class 'AssertionError'> └ <torch._utils.ExceptionWrapper object at 0x7fd632f4e748>
AssertionError: Caught AssertionError in DataLoader worker process 0. Original Traceback (most recent call last): File "/root/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "/root/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/root/anaconda3/envs/py36/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/root/YOLOX/yolox/data/datasets/datasets_wrapper.py", line 110, in wrapper
ret_val = getitem_fn(self, index)
File "/root/YOLOX/yolox/data/datasets/mosaicdetection.py", line 95, in getitem
img, labels, , _ = self._dataset.pull_item(index)
File "/root/YOLOX/yolox/data/datasets/voc.py", line 240, in pull_item
img = self.load_resized_img(index)
File "/root/YOLOX/yolox/data/datasets/voc.py", line 207, in load_resized_img
img = self.load_image(index)
File "/root/YOLOX/yolox/data/datasets/voc.py", line 220, in load_image
assert img is not None
AssertionError
my voc.py
!/usr/bin/env python3
-- coding:utf-8 --
Code are based on
https://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py
Copyright (c) Francisco Massa.
Copyright (c) Ellis Brown, Max deGroot.
Copyright (c) Megvii, Inc. and its affiliates.
import os import os.path import pickle import xml.etree.ElementTree as ET from loguru import logger
import cv2 import numpy as np
from yolox.evaluators.voc_eval import voc_eval
from .datasets_wrapper import Dataset from .voc_classes import VOC_CLASSES
class AnnotationTransform(object):
class VOCDetection(Dataset):