Using the updated file training appears two KeyError #4827
Replies: 3 comments
-
@qingyuan-JLAU 👋 hi, thanks for letting us know about this problem with YOLOv5 🚀. We've created a few short guidelines below to help users provide what we need in order to get started investigating a possible problem. How to create a Minimal, Reproducible ExampleWhen asking a question, people will be better able to provide help if you provide code that they can easily understand and use to reproduce the problem. This is referred to by community members as creating a minimum reproducible example. Your code that reproduces the problem should be:
In addition to the above requirements, for Ultralytics to provide assistance your code should be:
If you believe your problem meets all of the above criteria, please close this issue and raise a new one using the 🐛 Bug Report template and providing a minimum reproducible example to help us better understand and diagnose your problem. Thank you! 😃 |
Beta Was this translation helpful? Give feedback.
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Solved as @lotrmay mentioned. Added the below line to Solved!!! |
Beta Was this translation helpful? Give feedback.
-
The training model was successful, but using the updated file for training, the following two problems occurred.
Image sizes 640 train, 640 val
Using 8 dataloader workers
Logging results to runs\train\exp91
Starting training for 100 epochs...
0%| | 0/240 [00:00<?, ?it/s]
Traceback (most recent call last):
File "C:/Users/Monster/yolov5/train.py", line 611, in
main(opt)
File "C:/Users/Monster/yolov5/train.py", line 509, in main
train(opt.hyp, opt, device, callbacks)
File "C:/Users/Monster/yolov5/train.py", line 287, in train
for i, (imgs, targets, paths, _) in pbar: # batch -------------------------------------------------------------
File "E:\Anaconda3\envs\yolov5\lib\site-packages\tqdm\std.py", line 1178, in iter
for obj in iterable:
File "C:\Users\Monster\yolov5\utils\datasets.py", line 139, in iter
yield next(self.iterator)
File "E:\Anaconda3\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 517, in next
data = self._next_data()
File "E:\Anaconda3\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 1199, in _next_data
return self._process_data(data)
File "E:\Anaconda3\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 1225, in _process_data
data.reraise()
File "E:\Anaconda3\envs\yolov5\lib\site-packages\torch_utils.py", line 429, in reraise
raise self.exc_type(msg)
KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "E:\Anaconda3\envs\yolov5\lib\site-packages\torch\utils\data_utils\worker.py", line 202, in _worker_loop
data = fetcher.fetch(index)
File "E:\Anaconda3\envs\yolov5\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\Anaconda3\envs\yolov5\lib\site-packages\torch\utils\data_utils\fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\Monster\yolov5\utils\datasets.py", line 536, in getitem
img, labels = load_mosaic(self, index)
File "C:\Users\Monster\yolov5\utils\datasets.py", line 703, in load_mosaic
img4, labels4, segments4 = copy_paste(img4, labels4, segments4, p=self.hyp['copy_paste'])
KeyError: 'copy_paste'
I hope I can get your help
Beta Was this translation helpful? Give feedback.
All reactions