loss.py:result type Float can't be cast to the desired output type long int
Epoch gpu_mem box obj cls labels img_size
0%| | 0/1 [00:01
main(opt)
File "/home/data/yolov5-6.1/train.py", line 539, in main
train(opt.hyp, opt, device, callbacks)
File "/home/data/yolov5-6.1/train.py", line 331, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File "/home/data/yolov5-6.1/utils/loss.py", line 120, in __call__
tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets
File "/home/data/yolov5-6.1/utils/loss.py", line 217, in build_targets
indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices
RuntimeError: result type Float can't be cast to the desired output type long int
处理方式:https://blog.csdn.net/Thebest_jack/article/details/125649451
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步