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

Changing in Image Size Problem #3

Open
khawar-islam opened this issue Jul 6, 2021 · 3 comments
Open

Changing in Image Size Problem #3

khawar-islam opened this issue Jul 6, 2021 · 3 comments

Comments

@khawar-islam
Copy link

Hi @rishikksh20,

Thank you for your great work. When I give an image 224x224, it works fine. Then, I just changed image 224 to 112x112 and it gives an error. Any advice?

Code

"CeiT": CeiT(
        GPU_ID=GPU_ID,
        image_size=112,
        patch_size=4,
        dim=512,
        depth=20,
        num_classes=NUM_CLASS,
        heads=8,
        dropout=0.1,
        emb_dropout=0.1
        )

Traceback

    raise EinopsError(' Error while computing {!r}\n {}'.format(self, e))
einops.EinopsError:  Error while computing Rearrange('b c (h w) -> b c h w', h=14, w=14)
 Shape mismatch, 49 != 196
@rishikksh20
Copy link
Owner

Code is writing by making sure size should be 224 as mentioned in paper.
In this line :

Rearrange('b c (h w) -> b c h w', h=14, w=14)
change w=7 and h=7 and do the same in this line :
Rearrange('b c h w -> b (h w) c', h=14, w=14)

@khawar-islam
Copy link
Author

@rishikksh20 Thank you. It works.

@yuwanting828
Copy link

Hello! my input picture is 256x256. After the change to h=16, w=16, an error of 7 is != 256, Any advice?

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