SuperGlue-pytorch
SuperGlue-pytorch copied to clipboard
RuntimeError: Expected object of scalar type Double but got scalar type Float for sequence element 1 in sequence argument at position #1 'tensors'
Hi i run the train.py code as is just using the coco validation 2014 (all images are jpg) instead of the original dataset, i allways get this error:
File "..\SuperGlue-pytorch\models\superglue.py", line 83, in forward return self.encoder(torch.cat(inputs, dim=1)) RuntimeError: Expected object of scalar type Double but got scalar type Float for sequence element 1 in sequence argument at position #1 'tensors'
can you please help me understand what is the problem here?
thanks
@artiumb Hi, I missed the same issue with yours. Did you figured out any solution to solve this problem?
i added cast of (float) and( int) in some parts of the data that is passed to the forwart() of superglue, dont really remember wich one. but it was something related to indexing issue where one of the indexes was float instead of int, i would verify that everything you place in the data list has right indexes and theyre of type int, just run the fields in debug console.
Thank you for your reply. Could you send your project folder to my email? [email protected]
it is simple, change the code in this way
def forward(self, kpts, scores): inputs = [kpts.transpose(1, 2).double(), scores.unsqueeze(1).double()] return self.encoder(torch.cat(inputs, dim=1))