Andrew0613 / X-Restormer

ECCV2024:A Comparative Study of Image Restoration Networks for General Backbone Network Design
MIT License
52 stars 3 forks source link

OCAB block #3

Open nanmehta opened 9 months ago

nanmehta commented 9 months ago

I have a doubt; I was using OCAB type of block in my implementation.But there is an issue if the image size is not divisible by 8; hence it is resulting in reshaping errors. For example: einops.EinopsError: Error while processing rearrange-reduction pattern "b c (h p1) (w p2) -> (b h w) (p1 p2) c". Input tensor shape: torch.Size([1, 64, 84, 128]). Additional info: {'p1': 8, 'p2': 8}. Shape mismatch, can't divide axis of length 84 in chunks of 8

Andrew0613 commented 9 months ago

You need to make sure that your image size can be divisible by the window_size parameter in OCAB, otherwise, it won't work. You can try to pad or resize your image to a suitable size.