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

Error Float in Int64 #24

Open
pauline-viguier opened this issue May 6, 2024 · 1 comment
Open

Error Float in Int64 #24

pauline-viguier opened this issue May 6, 2024 · 1 comment

Comments

@pauline-viguier
Copy link

Hi, I tried to train Drenet Model with Pytorch version 1.9.0 but I've got this error : Traceback (most recent call last): File "C:\Users\pauli\Documents\Detection_boat\DRENet\DRENet\train.py", line 521, in train(hyp, opt, device, tb_writer, wandb) File "C:\Users\pauli\Documents\Detection_boat\DRENet\DRENet\train.py", line 300, in train loss, loss_items, adaptParams = compute_loss(pred, dgimgs.to(device), targets.to(device)) # loss scaled by batch_size File "C:\Users\pauli\Documents\Detection_boat\DRENet\DRENet\utils\loss.py", line 135, in call tcls, tbox, indices, anchors = self.build_targets(p[0], targets) # targets File "C:\Users\pauli\Documents\Detection_boat\DRENet\DRENet\utils\loss.py", line 256, 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 __int64

If someone can help me, thanks !!!

@WindVChen
Copy link
Owner

Hi @pauline-viguier ,

There seems a discussion about this problem [here]. A direct solution seems to change the version of Pytorch.

Also, you can also have a look at [this blog], which presents how to modify the code to solve the issue.

Hope these help.

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