So thomasjo
self.fc1 = nn.Linear(input_height * input_width, 20)

must be change to
self.fc1 = nn.Linear(input, 20)

which input is (10, 1, 20, 224) tensor and will be flatted by
x = torch.flatten(x, start_dim=1)  # Assumes input 'x' is batched

Is it right?