rebeen
(Rebeen)
1
How to solve this problem
out_layer1 = nn.Sequential(
nn.Conv2d(80, 32,kernel_size=3,groups=2),
nn.LayerNorm(32),
nn.Dropout(0.1)
)
data= torch.Tensor(64, 80, 3,3)
out = out_layer1(data)
print(out.shape)
RuntimeError: Given normalized_shape=[32], expected input with shape [*, 32], but got input of size[64, 32, 1, 1]
KaiHoo
(Kai Hu)
2
data= torch.Tensor(64, 80, 3,3)
out_w, out_h = 1, 1
out_layer1 = nn.Sequential(
nn.Conv2d(80, 32,kernel_size=3,groups=2),
nn.LayerNorm([32,out_w,out_h]),
nn.Dropout(0.1)
)
out = out_layer1(data)
print(out.shape)
data= torch.Tensor(64, 80, 5,5)
out_w, out_h = 3, 3
out_layer1 = nn.Sequential(
nn.Conv2d(80, 32,kernel_size=3,groups=2),
nn.LayerNorm([32,out_w,out_h]),
nn.Dropout(0.1)
)
out = out_layer1(data)
print(out.shape)
1 Like
rebeen
(Rebeen)
3
Thank you very much @KaiHoo
Mota_Lee
(Mota Lee)
4
Could you tell me how to solve problems like this with other data? Or how do you fix this bug?