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:all input tensors must be on the same device. received cuda:0 and cpu #90

Open
june2678 opened this issue Mar 23, 2021 · 1 comment

Comments

@june2678
Copy link

my pytorch version is 1.7.1
cuda version = 11.1 (because of RTX 3090)
when run python train.py ../configs/car_cfg.py

RuntimEerror:all input tensors must be on the same device. received cuda:0 and cpu
the error is in this line
"/SA-SSD-master/mmdet/models/single_stage_heads/ssd_rotate_head.py" line 368 in get_guided_anchors
top_labels = torch.cat([gt_lbls,top_labels],0)

@june2678
Copy link
Author

june2678 commented Mar 23, 2021

maybe I solve it
add top_labels = top_labels.to("cuda")
before top_labels = torch.cat([gt_lbls,top_labels],0)

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

1 participant