PyTorch-YOLOv3 icon indicating copy to clipboard operation
PyTorch-YOLOv3 copied to clipboard

TypeError: Caught TypeError in DataLoader worker process 0.

Open lambert66 opened this issue 3 years ago • 1 comments

Traceback (most recent call last): File "C:/Users/dell/Desktop/wc/PyTorch-YOLOv3-master/PyTorch-YOLOv3-master/pytorchyolo/train.py", line 257, in run() File "C:/Users/dell/Desktop/wc/PyTorch-YOLOv3-master/PyTorch-YOLOv3-master/pytorchyolo/train.py", line 154, in run for batch_i, (_, imgs, targets) in enumerate(tqdm.tqdm(dataloader,desc=f"Training Epoch{epoch}")): File "D:\Anaconda\envs\cyb\lib\site-packages\tqdm_tqdm.py", line 1060, in iter for obj in iterable: File "D:\Anaconda\envs\cyb\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next data = self._next_data() File "D:\Anaconda\envs\cyb\lib\site-packages\torch\utils\data\dataloader.py", line 1203, in _next_data return self._process_data(data) File "D:\Anaconda\envs\cyb\lib\site-packages\torch\utils\data\dataloader.py", line 1229, in _process_data data.reraise() File "D:\Anaconda\envs\cyb\lib\site-packages\torch_utils.py", line 434, in reraise raise exception TypeError: Caught TypeError in DataLoader worker process 0. Original Traceback (most recent call last): File "D:\Anaconda\envs\cyb\lib\site-packages\torch\utils\data_utils\worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "D:\Anaconda\envs\cyb\lib\site-packages\torch\utils\data_utils\fetch.py", line 52, in fetch return self.collate_fn(data) File "D:\Anaconda\envs\cyb\lib\site-packages\torch\utils\data_utils\collate.py", line 86, in default_collate raise TypeError(default_collate_err_msg_format.format(elem_type)) TypeError: default_collate: batch must contain tensors, numpy arrays, numbers, dicts or lists; found <class 'NoneType'> Is the cause of this error a problem with the package version?

lambert66 avatar Jul 01 '22 08:07 lambert66

It could be the case that you have a complete batch without any labels. The implementation doesn't fully support negative samples at the moment, as they are rarely used nowadays in object detection.

Flova avatar Jul 26 '22 10:07 Flova