RuntimeError: mat1 and mat2 shapes cannot be multiplied (128x32 and 1056x120)

Someone please help me out!

My model :
class logCNN(nn.Module):

def __init__(self, num_classes):
    super(logCNN, self).__init__()
    self.num_classes = num_classes
    self.features = nn.Sequential(
        
        nn.Conv2d(1, 16, kernel_size=2),
        nn.ReLU(),
        nn.MaxPool2d(kernel_size=2),
        nn.Conv2d(16, 32, kernel_size=2),
        nn.ReLU(),
        nn.MaxPool2d(kernel_size=2)
    )

    self.classifier = nn.Sequential(

        nn.Linear(1056, 120),
        nn.ReLU(),
        nn.Linear(120, 84),
        nn.ReLU(),
        nn.Linear(84, num_classes),
    )


def forward(self, x):
    x = self.features(x)
    x = torch.flatten(x, 1)
    logits = self.classifier(x)
    probas = F.softmax(logits, dim=1)
    return logits, probas

Based on the error message the in_features of the first linear layer do not match the feature dimension of the flattened activation.
Using:

    self.classifier = nn.Sequential(
        nn.Linear(32, 120),
        ...

should work.