QVPR / Patch-NetVLAD

Code for the CVPR2021 paper "Patch-NetVLAD: Multi-Scale Fusion of Locally-Global Descriptors for Place Recognition"
MIT License
525 stars 74 forks source link

can't assign a tuple to a torch.cuda.FloatTensor #35

Closed DonMuv closed 3 years ago

DonMuv commented 3 years ago

Hi, I get this error 'can't assign a tuple to a torch.cuda.FloatTensor' when I run train.py, and pooling = patchnetvlad in train.ini. The place where the error occurred is: vlad_encoding = net.pool(image_encoding) pvecs[i bs:(i + 1) bs, :] = vlad_encoding and vlad_encoding: ([tensor([[[ 0.0000e+00, 0.0000e+00, 0.0000e+00, ...,

But when pooling = netvlad in train.ini vlad_encoding: tensor([[[-5.1483e-03, -2.0104e-02, 0.0000e+00, ..., The above error will not appear

Tobias-Fischer commented 3 years ago

Hi, please refer to https://github.com/QVPR/Patch-NetVLAD/issues/27

In short, training with patchnetvlad pooling doesn't work - instead train with netvlad pooling and then apply patchnetvlad pooling at inference time.