Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Expected object of scalar type Double but got scalar type Float for sequence element 1 in sequence argument at position #1 'tensors' #11

Open
artiumb opened this issue Oct 29, 2020 · 4 comments

Comments

@artiumb
Copy link

artiumb commented Oct 29, 2020

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

@BruceWANGDi
Copy link

@artiumb Hi,
I missed the same issue with yours. Did you figured out any solution to solve this problem?

@artiumb
Copy link
Author

artiumb commented Dec 27, 2020

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.

@BruceWANGDi
Copy link

Thank you for your reply. Could you send your project folder to my email? cdjsdq@gmail.com

@reality167
Copy link

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))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants