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

换了OTALoss,训练报了错(i changed to use OTALoss, and when starting training, the errors occur) #648

Open
oldg00se opened this issue Mar 10, 2024 · 1 comment

Comments

@oldg00se
Copy link

Traceback (most recent call last):
File "e:\yolov5-6.1-ota\train-ota.py", line 655, in
main(opt)
File "e:\yolov5-6.1-ota\train-ota.py", line 551, in main
train(opt.hyp, opt, device, callbacks)
File "e:\yolov5-6.1-ota\train-ota.py", line 342, in train
loss, loss_items = compute_loss(pred, targets.to(device), imgs) # loss scaled by batch_size
File "E:\anaconda\envs\yolov5\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
File "E:\anaconda\envs\yolov5\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl
return forward_call(*args, **kwargs)
File "e:\yolov5-6.1-ota\utils\ota.py", line 147, in forward
return self.get_losses(
File "e:\yolov5-6.1-ota\utils\ota.py", line 337, in get_losses
reg_target = gt_bboxes_per_image[matched_gt_inds]
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

@Chriost
Copy link

Chriost commented Dec 1, 2024

same problem, do you solve?

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