When it says the input sizes for your network must be same, it means that the images that you input to your model say Resnet should be of same size at every iteration for maximum performance.
When you enable cudnn benchmark, what it does is, before beginning the training of your model it optimizes your model based on your inputs for maximum performance on the gpu. That is why when you start training with the benchmark=True, it takes some time before the actual training starts.
Now if your input size is changing at every iteration then it will do the optimization at every epoch, making the learning process slower.
Note:-By changing input size, I am not referring to the size of images that the dataloader reads from disk. I am referring to the output images from the dataloader.
Yes, it is fine to resize your images at every iteration with the benchmark=True