Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
armstronglzh opened this issue Apr 12, 2024 · 3 comments

Comments

@armstronglzh
Copy link

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
Copy link
Author

cuda:11.8
python:3.8

@iamrukeshduwal
Copy link

Have anyone got the solution?

@armstronglzh
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants