How to transfer learning to resnet18

I load Resnet18 net,and reset fc layer nn.Linear(512,100).But,when I use it to train cifar100, it occur a error:
RuntimeError: Given input size: (512x1x1). Calculated output size: (512x-5x-5). Output size is too small .

This why?and how to solve it? please forgive me,I am stupid

Resnets are built for fixed size input images, and you must be feeding it images that are too small. I think one of the pooling layers is producing that error.

You need to scale your input images up before feeding them to the resnet.

cifar100 images are 32x32
resnet is built (as far as I can tell from 2s on google) for images of size 224x224