mihaidusmanu / d2-net

D2-Net: A Trainable CNN for Joint Description and Detection of Local Features
Other
761 stars 163 forks source link

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

Open pfvaldez opened 1 year ago

pfvaldez commented 1 year ago

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 commented 1 year ago

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