How we can set window image size on 112x112 image
See original GitHub issueHi
Thank you for your great work. My Image size is 112x112 and the head is 12 and my window size is 7. It does not work for me.
Traceback
File "/raid/khawar/PycharmProjects/thesis/vit_pytorch/SwinT/swin.py", line 111, in forward
q, k, v = map(
File "/raid/khawar/PycharmProjects/thesis/vit_pytorch/SwinT/swin.py", line 112, in <lambda>
lambda t: rearrange(t, 'b (nw_h w_h) (nw_w w_w) (h d) -> b h (nw_h nw_w) (w_h w_w) d',
File "/raid/khawar/anaconda3/envs/vision-transformer-pytorch/lib/python3.8/site-packages/einops/einops.py", line 424, in rearrange
return reduce(tensor, pattern, reduction='rearrange', **axes_lengths)
File "/raid/khawar/anaconda3/envs/vision-transformer-pytorch/lib/python3.8/site-packages/einops/einops.py", line 376, in reduce
raise EinopsError(message + '\n {}'.format(e))
einops.EinopsError: Error while processing rearrange-reduction pattern "b (nw_h w_h) (nw_w w_w) (h d) -> b h (nw_h nw_w) (w_h w_w) d".
Input tensor shape: torch.Size([1, 3, 3, 384]). Additional info: {'h': 24, 'w_h': 7, 'w_w': 7}.
Shape mismatch, can't divide axis of length 3 in chunks of 7
Regards, Khawar
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
How to resize an image on your Windows PC or Mac
Open the image you want to resize using the Photos app. · Click the ellipsis button on the menu bar at the top,...
Read more >How to Resize an Image on Windows Using Built-in Apps
1. Double-click the image file you want to resize to open it in Photos. · 2. Once it's opened, click the three dots...
Read more >How to Use the Windows 10 Photos App to Resize Images
Resize Images Windows 10 Photos App. To resize an image, open the Photos app and choose the picture from your library that you...
Read more >4.2. Change the Size of an Image (Scale)
Problem: you have a huge image and you want to resize the is so that it will ... image, GIMP will set the...
Read more >Resize PNG Online - Resizing.app
Use Resizing.app, Photoshop, or built-in options of your operating system to resize png images by width, height, by percentage, or set custom parameters....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You may change the window size of the last stage as 3x3 or 4x4 (the feature map size). Another solution is to use padding.
@scott870430 You can try bicubic interpolation to leverage the pretrained model weights with different window size