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