positive666 / yolo_research

based on yolo-high-level project (detect\pose\classify\segment\):include yolov5\yolov7\yolov8\ core ,improvement research ,SwintransformV2 and Attention Series. training skills, business customization, engineering deployment C
GNU General Public License v3.0
756 stars 145 forks source link

yolov5s_swinv2_head.yaml 跑这个模型一直报错。 #55

Closed EricLvbaoLiang closed 2 years ago

EricLvbaoLiang commented 2 years ago

❔Question

yolov5s_swinv2_head.yaml 跑这个模型一直报错。

Additional context

第一个eopch快结束的时候就报错。 81F2B9B4882BC5437CDB16522AD408AC

EricLvbaoLiang commented 2 years ago

❔Question

yolov5s_swinv2_head.yaml 跑这个模型一直报错。

Additional context

第一个eopch快结束的时候就报错。 81F2B9B4882BC5437CDB16522AD408AC

 Epoch   gpu_mem       box       obj       cls    labels  img_size
 0/299     3.34G       nan       nan         0        39       640: 100%|██████████| 250/250 [00:59<00:00,  4.17it/s]
           Class     Images     Labels          P          R     mAP@.5 mAP@.5:.95:   0%|          | 0/34 [00:00<?, ?it/s]

Traceback (most recent call last): File "/home/liuqinyi/lbl/yolov5_research-master/train.py", line 739, in main(opt) File "/home/liuqinyi/lbl/yolov5_research-master/train.py", line 636, in main train(opt.hyp, opt, device, callbacks) File "/home/liuqinyi/lbl/yolov5research-master/train.py", line 460, in train results, maps, = val.run(data_dict, File "/home/liuqinyi/anaconda3/envs/lbl/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context return func(*args, kwargs) File "/home/liuqinyi/lbl/yolov5_research-master/val.py", line 209, in run out, train_out = model(im) if training else model(im, augment=augment, val=True) # inference, loss outputs File "/home/liuqinyi/anaconda3/envs/lbl/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, *kwargs) File "/home/liuqinyi/lbl/yolov5_research-master/models/yolo.py", line 500, in forward return self._forward_once(x, profile, visualize) # single-scale inference, train File "/home/liuqinyi/lbl/yolov5_research-master/models/yolo.py", line 523, in _forward_once x = m(x) # run File "/home/liuqinyi/anaconda3/envs/lbl/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(input, kwargs) File "/home/liuqinyi/lbl/yolov5_research-master/models/common.py", line 2276, in forward x = blk(x, attn_mask) File "/home/liuqinyi/anaconda3/envs/lbl/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, *kwargs) File "/home/liuqinyi/lbl/yolov5_research-master/models/common.py", line 1979, in forward attn_windows = self.attn(x_windows, mask=attn_mask) # [nWB, MhMw, C] File "/home/liuqinyi/anaconda3/envs/lbl/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(input, **kwargs) File "/home/liuqinyi/lbl/yolov5_research-master/models/common.py", line 1895, in forward x = torch.einsum("bhal, bhlv -> bhav", attn, v) File "/home/liuqinyi/anaconda3/envs/lbl/lib/python3.8/site-packages/torch/functional.py", line 360, in einsum return _VF.einsum(equation, operands) # type: ignore[attr-defined] RuntimeError: expected scalar type Half but found Float

wch243294382 commented 2 years ago

输命令时要--swin_float

EricLvbaoLiang commented 2 years ago

输命令时要--swin_float

感谢