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: indices should be on the same device as the indexed tensor in MMRotate tutorial #12303

Open
ramondalmau opened this issue Feb 7, 2025 · 0 comments
Assignees

Comments

@ramondalmau
Copy link

Description:
I encountered a RuntimeError when following the MMRotate tutorial. The error occurs when running inference_detector(model, img). My model is on cuda:0, but it seems like some indices are on the CPU, causing a mismatch.

Error Message:
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

Environment:

  • CUDA: 12.4
  • PyTorch: 2.6.0
  • MMDetection: 2.28.2
  • MMCV: 1.7.2
  • MMRotate: 0.3.4
  • GPU: NVIDIA RTX A4500
  • OS: Red Hat Enterprise Linux release 8.9 (Ootpa)

Steps to Reproduce:

  1. Install MMRotate following the official guide.
  2. Load a model and set it to cuda:0.
  3. Run inference_detector(model, img).
  4. The error occurs.

Expected Behavior:
The inference should run without device mismatch issues.

What I Tried:

  • Reinstalling dependencies.

Let me know if you need additional logs or debugging outputs.

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