yolov5_obb icon indicating copy to clipboard operation
yolov5_obb copied to clipboard

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

Open armstronglzh opened this issue 10 months ago • 3 comments

Traceback (most recent call last): File "train.py", line 633, in main(opt) File "train.py", line 530, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 326, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "/home/lzh/yolov5_obb/utils/loss.py", line 136, in call tcls, tbox, indices, anchors, tgaussian_theta = self.build_targets(p, targets) # targets File "/home/lzh/yolov5_obb/utils/loss.py", line 268, in build_targets indices.append((b, a, gj.clamp_(0, feature_wh[1] - 1), gi.clamp_(0, feature_wh[0] - 1))) # image, anchor, grid indices RuntimeError: result type Float can't be cast to the desired output type long int

how can i revise the code

armstronglzh avatar Apr 12 '24 10:04 armstronglzh

cuda:11.8 python:3.8

armstronglzh avatar Apr 12 '24 10:04 armstronglzh

Have anyone got the solution?

iamrukeshduwal avatar Apr 18 '24 02:04 iamrukeshduwal

I have changed the cuda version to 11.3 and follow the writer's instruction step by step,the problem then has been solved

armstronglzh avatar Apr 18 '24 02:04 armstronglzh