cv516Buaa / tph-yolov5

GNU General Public License v3.0
716 stars 170 forks source link

RuntimeError: result type Float can't be cast to the desired output type long int #45

Open xiaomujiang opened 2 years ago

xiaomujiang commented 2 years ago

使用默认的进行训练,有个报错 File "train.py", line 527, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 324, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size tph-yolov5/utils/loss.py", line 243, in buildtargets 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

zhongranHerz commented 2 years ago

https://blog.csdn.net/weixin_49148527/article/details/126023156 这里有教程,修改好就能跑通