Hi,
yes, you can simply change the kernel size, but to avoid the error message you have to insert that factor 4 if I’m not mistaken. You can simply check your network by adding
    print(x.shape)

before performing the view operation. E.g. if x has shape (4, 16, 6,6), the view operation
    x = x.view(-1, self.kernel_size * self.kernel_size * 16) # kernel size = 3

would result in a tensor of shape (16,144) resulting in an output shape of (16,10) while you’re expecting an output of (4,10). So you need to take care of that.