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

Input image height (128) doesn't match model (256). #88

Closed
NoahRe1 opened this issue Dec 15, 2023 · 2 comments
Closed

Input image height (128) doesn't match model (256). #88

NoahRe1 opened this issue Dec 15, 2023 · 2 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@NoahRe1
Copy link

NoahRe1 commented Dec 15, 2023

After changing the patch_size of SwinLSTM_B to 4, an error occurred: Input image height (128) doesn't match model (256).

This error is coming from this piece of code:

class PatchInflated(nn.Module):
    def __init__(self, in_chans, embed_dim, input_resolution, stride=2, padding=1, output_padding=1):
        super(PatchInflated, self).__init__()

        stride = to_2tuple(stride)
        padding = to_2tuple(padding)
        output_padding = to_2tuple(output_padding)
        self.input_resolution = input_resolution

        self.Conv = nn.ConvTranspose2d(in_channels=embed_dim, out_channels=in_chans, kernel_size=(3, 3),
                                       stride=stride, padding=padding, output_padding=output_padding)

It performs upsampling with a factor of 2, and when the patch_size is 4, the output no longer matches the original image size.

@54wb
Copy link
Contributor

54wb commented Dec 16, 2023

Hi,

Thank you very much for your interest! We have also noticed this bug and asked for the anthor about it, you can reference this SongTang-x/SwinLSTM#5 (comment) issue for add a new layer to upsample the input. We also will update this code for later. Hope my answer makes sense to you.

Best regards,

@Lupin1998 Lupin1998 added help wanted Extra attention is needed question Further information is requested labels Dec 29, 2023
@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
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants