The linear layer will have a weight parameter in the shape [4, 8] and an input in the shape [8, 64] will raise a shape mismatch error, since 8 input features are expected.
@ptrblck Thank you sir. Plz, comment on whether I am correct with the second answer. Also If I am printing x.shape in this forward function,
def forward(self, *input):
#print(input[0].shape)
xa = self.conv1a(input[0])
xa = self.bn1a(xa)
xa = F.relu(xa)
xb = self.conv1b(input[0])
xb = self.bn1b(xb)
xb = F.relu(xb)
x = torch.cat((xa, xb), 1)
x = self.conv2(x)
x = self.bn2(x)
x = F.relu(x)
x = self.maxp(x)
..
..
x = self.conv5(x)
x = self.bn5(x)
x = F.relu(x)
print(x.shape)
Sir I know the shape is printed as many times as the total_samples, Sir @ptrblck Here 80 is the output channels, 6*15 is the shape of each channel output. But I am not getting why this o dimension is changing every time.
Regards
Assuming dim0 represents the batch dimension, the activation shapes seem wrong, since the number of samples would change at these points.
Could you post an executable code snippet, which would reproduce this behavior?