d2-net icon indicating copy to clipboard operation
d2-net copied to clipboard

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

Open pfvaldez opened this issue 2 years ago • 1 comments

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.

pfvaldez avatar Jan 19 '23 08:01 pfvaldez

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

jac08h avatar Jan 23 '23 08:01 jac08h