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

Extracting features encountered RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) #97

Open
pfvaldez opened this issue Jan 19, 2023 · 1 comment

Comments

@pfvaldez
Copy link

Hello thank you for your work.
I would like to ask for assistance, I tried running the extract_features.py

I encountered this error:

File "../d2-net/extract_features.py", line 114, in
keypoints, scores, descriptors = process_multiscale(
File "../Development/d2-net/lib/pyramid.py", line 86, in process_multiscale
fmap_pos = fmap_pos[:, ids]
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)

I use pytorch= 1.13.1 in my conda environment and have a GPU recognized as device.
Also, I already tried git pull to make sure the repo was up to date.
But I still encountered this error. Please help.

@jac08h
Copy link

jac08h commented Jan 23, 2023

I fixed the issue but inserting ids = ids.cpu() before the line where the error occurs.

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