title: Why am I getting calculated padding input size per channel smaller than kernel size?
body: <p>I have the following model but its returning an error. Not sure why. I have tried googling but not found anything so far. My input is an numpy array of 6 by 6.</p>
  <pre><code>class Net(nn.Module):
      def __init__(self):
          super().__init__()
          self.conv1 = nn.Conv2d(1, 16, kernel_size=(3,3), stride=1, padding=0)
          self.conv2 = nn.Conv2d(16, 32, kernel_size=(3,3), stride=1, padding=0)
          self.conv3 = nn.Conv2d(32, 64, kernel_size=(3,3), stride=1, padding=0)
  
          self.fc1 = nn.Linear(64*4*4, 320)
          self.fc2 = nn.Linear(320, 160)
          self.out = nn.Linear(160, 2)
  
  
      def forward(self, x):
          x = self.conv1(x)
          x = F.relu(x)
          x = F.max_pool2d(x, kernel_size=2, stride=2)
  
          x = self.conv2(x)
          x = F.relu(x)
          x = F.max_pool2d(x, kernel_size=2, stride=2)
  
          x = self.conv3(x)
          x = F.relu(x)
          x = F.max_pool2d(x, kernel_size=2, stride=2)
  
          x = x.reshape(-1, 64*4*4)
          #x = torch.flatten(x)
  
          x = F.relu(self.fc1(x))
          x = F.relu(self.fc2(x))
          x = self.out(x)
          return F.softmax(x, dim=1)
  </code></pre>
  <p>My input is a 6x6 numpy array and I get the following error, any idea why?</p>
  <pre><code>RuntimeError: Calculated padded input size per channel: (2 x 2). Kernel size: (3 x 3). Kernel size can't be greater than actual input size
  </code></pre>