Hi,



 MUHAMMAD_JAHANZAIB_K:

x = x.view(x.size(0), -1)


Conv2d accepts inputs in this manner [batch_size, channel_size, height, width]. So, for an rabitrary input x = torch.randn(1, 3, 136, 136) you are resizing it into 2d tensor which is not proper for a Conv2d operator which takes 3d input. In the error also you can see that it says “got 2d tensor with size of (136, 408)” where 408=136*3. if you remove the aforementioned line, your model will work properly. Although, layer11 has never been used which leads to another mismatch error in layer 17.
bests