GuoLanqing / ShadowFormer

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

RuntimeError after five epoch #15

Closed Meow-2 closed 1 year ago

Meow-2 commented 1 year ago

dataset: AISTD command: python train.py --warmup --win_size 8 --train_ps 256

File "/home/zk/Code/Python/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, 7, 8, 10, 8, 256]' is invalid for input of size 1228800

How can I fix it?

GuoLanqing commented 1 year ago

What's your training image size? 256*256 or original size?

Meow-2 commented 1 year ago

What's your training image size? 256*256 or original size?

original size, 640*480

GuoLanqing commented 1 year ago

For that size, I recommend using the --win_size 10 --train_ps 320 or --win_size 10 --train_ps 240. If train_ps is larger, the performance would be better.

Meow-2 commented 1 year ago

Thank you, it works well now.