错误代码:
File "D:\Users\Administrator\miniconda3\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "E:\project\weilan\YOLOv5-Lite-master\train.py", line 12, in <module>
import torch.distributed as dist
File "D:\Users\Administrator\miniconda3\lib\site-packages\torch_init.py", line 117, in <module>
raise err
OSError: [WinError 1455] 页面文件太小,无法完成操作。 Error loading "D:\Users\Administrator\miniconda3\lib\site-packages\torch\lib\caffe2_detectron_ops_gpu.dll" or one of its dependencies.
Traceback (most recent call last):
File "E:/project/weilan/YOLOv5-Lite-master/train.py", line 544, in <module>
train(hyp, opt, device, tb_writer)
File "E:/project/weilan/YOLOv5-Lite-master/train.py", line 203, in train
pad=0.5, prefix=colorstr('val: '))[0]
File "E:\project\weilan\YOLOv5-Lite-master\utils\datasets.py", line 142, in create_dataloader
collate_fn=LoadImagesAndLabels.collate_fn4 if quad else LoadImagesAndLabels.collate_fn)
File "E:\project\weilan\YOLOv5-Lite-master\utils\datasets.py", line 155, in init
self.iterator = super().iter()
File "D:\Users\Administrator\miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 352, in iter
return self._get_iterator()
File "D:\Users\Administrator\miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 294, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "D:\Users\Administrator\miniconda3\lib\site-packages\torch\utils\data\dataloader.py", line 801, in init
w.start()
File "D:\Users\Administrator\miniconda3\lib\multiprocessing\process.py", line 112, in start
self._popen = self._Popen(self)
File "D:\Users\Administrator\miniconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "D:\Users\Administrator\miniconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "D:\Users\Administrator\miniconda3\lib\multiprocessing\popen_spawn_win32.py", line 89, in init
reduction.dump(process_obj, to_child)
File "D:\Users\Administrator\miniconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
BrokenPipeError: [Errno 32] Broken pipe
Process finished with exit code 1
原因:多进程加载数据,超过cpu核数了,
解决方法,减小workers,我的改为4可以了。
版权说明 : 本文为转载文章, 版权归原作者所有 版权申明
原文链接 : https://blog.csdn.net/jacke121/article/details/121299389
内容来源于网络,如有侵权,请联系作者删除!