Traceback (most recent call last): File "E:\yolov5-master\train.py", line 642, in <module> main(opt) File "E:\yolov5-master\train.py", line 531, in main train(opt.hyp, opt, device, callbacks) File "E:\yolov5-master\train.py", line 286, in train for i, (imgs, targets, paths, _) in pbar: # batch ------------------------------------------------------------- File "F:\conda\envs\yolov5\lib\site-packages\tqdm\std.py", line 1178, in __iter__ for obj in iterable: File "E:\yolov5-master\utils\dataloaders.py", line 172, in __iter__ yield next(self.iterator) File "F:\conda\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 633, in __next__ data = self._next_data() File "F:\conda\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 1328, in _next_data idx, data = self._get_data() File "F:\conda\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 1284, in _get_data success, data = self._try_get_data() File "F:\conda\envs\yolov5\lib\site-packages\torch\utils\data\dataloader.py", line 1145, in _try_get_data raise RuntimeError('DataLoader worker (pid(s) {}) exited unexpectedly'.format(pids_str)) from e RuntimeError: DataLoader worker (pid(s) 19928, 15752) exited unexpectedly.
时间: 2023-07-21 18:51:23 浏览: 169
linux 下 pip3 报错“ File “/usr/bin/pip3”, line 9, in from pip import mainImportError: canno”处理
5星 · 资源好评率100%
根据你提供的错误信息,这是在运行YOLOv5的训练脚本时出现的错误。错误信息显示,DataLoader的worker进程出现了异常退出,可能是由于某些原因导致数据加载失败。建议你检查一下数据集是否正确加载,并且文件路径是否正确。此外,你也可以尝试增加num_workers参数的数量来尝试解决问题,例如将其从默认值0增加到2或更多。如果问题仍然存在,你可以尝试使用其他的数据加载器,例如PyTorch的ImageFolder数据加载器,来加载数据集。
阅读全文