How do I change the input and size if I want to classify MNIST with VGG16?

I want to classify MNIST with VGG16, but the input is set to 3, which does not fit the size of the MNIST input.Should VGG16 be adjusted to MNIST to match this input size with the size of the image? If so, how should I do this?

You could try a few different approaches:

  • repeat the input channels of the MNIST data
  • replace the first conv layer of VGG16 with a new one expecting a single input channel
  • reduce the in_channels of the first conv layer kernel e.g. via a mean, sum, median etc. operation

If I replace the first conv layer of VGG16 with a new layer that assumes one input channel, should I divide the numpy array by 225 and then Resize to 224 for the MNIST image?

Yes, if the input is [0,255] you need to bring it between [0,1] and since VGG16 expects an input of size 224x224, you need to resize it.