The errors are raised for different reasons:


ValueError: Expected input batch_size (2304) to match target batch_size (64): this is often raised, if you are using a wrong view or reshape operation and are changing the batch size, so I always recommend to use e.g. x.view(x.size(0), -1) to flatten a tensor instead of x.view(-1, some_size).

RuntimeError: size mismatch, m1: [64 x 9216], m2: [256 x 512]: this is raised if the number of features from the incoming tensor doesn’t match the in_features of the linear layer.

RuntimeError: Calculated padded input size per channel: (1 x 1). Kernel size: (3 x 3). Kernel size can’t...: this is raised if your input is too small and thus the conv layer cannot be applied to the incoming activation, since the kernel size is larger in its spatial size than the padded input.

PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.