`*** RuntimeError: mat1 dim 1 must match mat2 dim 0` whenever I run model(images)
问题 def __init__(self): super().__init__() self.conv = nn.Sequential( nn.Conv2d(1, 64, kernel_size=5, stride=2, bias=False), nn.BatchNorm2d(64), nn.ReLU(), nn.Conv2d(64, 64, kernel_size=3, stride=2, bias=False), nn.BatchNorm2d(64), nn.ReLU(), nn.Conv2d(64, 64, kernel_size=3, stride=2, bias=False), nn.BatchNorm2d(64), ) How can I deal with this error? I think the error is with self.fc, but I can't say how to fix it. 回答1: The output from self.conv(x) is of shape torch.Size([32, 64, 2, 2]) : 32*64*2