GuoLanqing / ShadowFormer

ShadowFormer (AAAI2023), Pytorch implementation
MIT License
129 stars 17 forks source link

RuntimeError when training's evaluation #27

Closed BlackJoke76 closed 1 year ago

BlackJoke76 commented 1 year ago

dataset: SRD training image size: original size 840 * 640 command: python train.py --warmup --win_size 10 --train_ps 320

File "/home/ShadowFormer/model.py", line 546, in window_partition
    x = x.view(B, H // win_size, win_size, W // win_size, win_size, C)
RuntimeError: shape '[1, 8, 10, 10, 10, 256]' is invalid for input of size 2150400

How can I fix it?

GuoLanqing commented 1 year ago

The error is due to the testing image size is not the integer multiples of 16*win_size. You can solve it by padding the testing image (please refer to args.tile in text.py).

BlackJoke76 commented 1 year ago

thank you