Where did you get the pretrained densenet model? (is it from pytorch? If so, there should be a pretrained 224 by 224 model somewhere)…
But if you trained a 300 x 300 image model yourself and now want to use 224 by 224 images you can rescale the images to 300 by 300 to work with the model with something like this 24.