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: The size of tensor a (60) must match the size of tensor b (59) at non-singleton dimension 3 #140

Closed
daemonkillerr opened this issue May 31, 2024 · 2 comments

Comments

@daemonkillerr
Copy link

I have a custom dataset of 59x59 images and I face this error. Kindly help.

File openstl\openstl\models\simvp_model.py:95, in Decoder.forward(self, hid, enc1)
93 for i in range(0, len(self.dec)-1):
94 hid = self.deci
---> 95 Y = self.dec[-1](hid + enc1)
96 Y = self.readout(Y)
97 return Y

RuntimeError: The size of tensor a (60) must match the size of tensor b (59) at non-singleton dimension 3

Thanks

@chengtan9907
Copy link
Owner

In SimVP, the image is downsampled and then upsampled back to its original size. However, 59x59 images cannot be upsampled back to the same dimensions. To address this, I suggest padding your image to 60x60 at the beginning of the forward function and removing the padding at the end of the forward function.

@chengtan9907
Copy link
Owner

I will close this issue if there are no more questions. Please feel free to open a new issue when you have new questions.

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

2 participants