mihaidusmanu / d2-net

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

Multiscale running error #53

Closed GrumpyZhou closed 4 years ago

GrumpyZhou commented 4 years ago

Hi @mihaidusmanu ,

When i try to run extract_feature.py with --multiscales option, i got first following error

"d2-net/lib/pyramid.py", line 45, in process_multiscale
    banned = F.interpolate(banned.float(), size=[h, w]).bool()
AttributeError: 'Tensor' object has no attribute 'bool'

Then i changed it to banned = F.interpolate(banned.float(), size=[h, w]).to(torch.bool) and worked. And next i got this error:

  File "extract_features.py", line 119, in <module>
    model
  File "d2-net/lib/pyramid.py", line 46, in process_multiscale
    detections = torch.min(detections, ~banned)
TypeError: ~ (operator.invert) is only implemented on byte tensors

I wonder which pytorch are you using? My current environment:

python                    3.7.3
pytorch                   1.1.0           py3.7_cuda10.0.130_cudnn7.5.1_0    pytorch
cudatoolkit             10.0.130
mihaidusmanu commented 4 years ago

The repository was recently updated for PyTorch 1.2+ which added support for boolean tensors. Let me know if you run into any issues on a more recent version.