训练时计算维度出错
JusticeLin opened this issue · 1 comments
在使用DAT时出现了如下错误,参数是按照config设置的,与config一致,每一种方案都试过了,都会报错,麻烦帮忙看下
File "/root/BasicSR-master/basicsr/archs/discriminator_arch.py", line 202, in forward
x_total = einops.rearrange(x, 'b c (r1 h1) (r2 w1) -> b (r1 r2) (h1 w1) c', h1=self.window_size[0], w1=self.window_size[1]) # B x Nr x Ws x C
File "/root/miniconda3/lib/python3.8/site-packages/einops/einops.py", line 487, in rearrange
return reduce(tensor, pattern, reduction='rearrange', **axes_lengths)
File "/root/miniconda3/lib/python3.8/site-packages/einops/einops.py", line 418, in reduce
raise EinopsError(message + '\n {}'.format(e))
einops.EinopsError: Error while processing rearrange-reduction pattern "b c (r1 h1) (r2 w1) -> b (r1 r2) (h1 w1) c".
Input tensor shape: torch.Size([128, 96, 32, 32]). Additional info: {'h1': 7, 'w1': 7}.
Shape mismatch, can't divide axis of length 32 in chunks of 7
@JusticeLin There is a mismatch in the shape of the inputs and the size of the window, since 32 cannot be divided by 7.