Detecting objects: 0%| | 0/619 [00:00, ?it/s]Traceback (most recent call last):
File "E:/PyTorch-YOLOv3-master/test.py", line 98, in
batch_size=8,
File "E:/PyTorch-YOLOv3-master/test.py", line 36, in evaluate
for batch_i, (_, imgs, targets) in enumerate(tqdm.tqdm(dataloader, desc="Detecting objects")):
File "D:Anaconda\envs\PyTorch-YOLOv3-master\lib\site-packages\tqdm\std.py", line 1108, in __iter__
for obj in iterable:
File "D:Anaconda\envs\PyTorch-YOLOv3-master\lib\site-packages\torch\utils\data\dataloader.py", line 345, in __next__
data = self._next_data()
File "D:Anaconda\envs\PyTorch-YOLOv3-master\lib\site-packages\torch\utils\data\dataloader.py", line 856, in _next_data
return self._process_data(data)
File "D:Anaconda\envs\PyTorch-YOLOv3-master\lib\site-packages\torch\utils\data\dataloader.py", line 881, in _process_data
data.reraise()
File "D:Anaconda\envs\PyTorch-YOLOv3-master\lib\site-packages\torch_utils.py", line 394, in reraise
raise self.exc_type(msg)
RuntimeError: Caught RuntimeError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "D:Anaconda\envs\PyTorch-YOLOv3-master\lib\site-packages\torch\utils\data_utils\worker.py", line 178, in _worker_loop
data = fetcher.fetch(index)
File "D:Anaconda\envs\PyTorch-YOLOv3-master\lib\site-packages\torch\utils\data_utils\fetch.py", line 47, in fetch
return self.collate_fn(data)
File "E:\PyTorch-YOLOv3-master\utils\datasets.py", line 141, in collate_fn
targets = torch.cat(targets, 0)
RuntimeError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat. This usually means that this function requires a non-empty list of Tensors. Available functions are [CUDATensorId, CPUTensorId, VariableTensorId]
Hi, I ran into the same problem. Did you ever solve the issue?
Hi, I ran into the same problem. Did you ever solve the issue?
Yes!
I edited a bit the code in datasets.py as below."JPEGImages" is the name of image file in VOC.
self.label_files = [
path.replace("JPEGImages", "labels").replace(".png", ".txt").replace(".jpg", ".txt")
for path in self.img_files
]
I slove this problem by increase the batch_size from 1 to 2, you can increase more if your gpu memory allow.
I ran into the same problem. I solve it by modifying the path of validation dataset.
I slove this problem by increase the batch_size from 1 to 2, you can increase more if your gpu memory allow.
quite frustrating... I think I'm stuck with batch_size == 1, anything other than this gives CUDA out of mem error...
I ran into the same problem. I solve it by modifying the path of validation dataset.
could you elaborate please?
I ran into the same problem. I solve it by modifying the path of validation dataset.
could you elaborate please?
I think it may be that the model does not receive data, so I re-modified the path.
the same problem, oh my god
Apparently both, the images directory, and the labels directory, need to be located under the data directory.
This link may be useful:
https://github.com/ninesinc/detectron2/commit/1eef1fa6d0cb00eb5ba5a9a28e0732f12bbb2879
I ran into the same problem. I solve it by modifying the path of validation dataset.
could you elaborate please?
I think it may be that the model does not receive data, so I re-modified the path.
请问能详细说一下是怎么修改的吗?
如果是直接跑yolov3代码,并不是自己修改了训练集之类的应该是不会出这个错的。如果出错,则是路径的问题,我修改 batch_size和作者提供的解决方案都没能解决。我是由于labels文件夹里还有一个labels子文件夹,所以找不到训练集和测试集label的路径了,只留下一个labels文件夹就行了。
It can be solved by modifing your data path, which should be, such as: ~\PyTorch-YOLOv3\data\coco\images\train2014; ~\PyTorch-YOLOv3\data\coco\labels\val2014。
Most helpful comment
如果是直接跑yolov3代码,并不是自己修改了训练集之类的应该是不会出这个错的。如果出错,则是路径的问题,我修改 batch_size和作者提供的解决方案都没能解决。我是由于labels文件夹里还有一个labels子文件夹,所以找不到训练集和测试集label的路径了,只留下一个labels文件夹就行了。