CeiT-pytorch
CeiT-pytorch copied to clipboard
Changing in Image Size Problem
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
Code is writing by making sure size should be 224 as mentioned in paper. In this line : https://github.com/rishikksh20/CeiT-pytorch/blob/d41cb23743fbb34c4354564a958f1d78de4e2770/module.py#L121 change w=7 and h=7 and do the same in this line : https://github.com/rishikksh20/CeiT-pytorch/blob/d41cb23743fbb34c4354564a958f1d78de4e2770/module.py#L127
@rishikksh20 Thank you. It works.
Hello! my input picture is 256x256. After the change to h=16, w=16, an error of 7 is != 256, Any advice?