Structuring CIFAR100 for resnet18
PyTorch offers a range of transformations and you can simply apply a transformation to resize your images when loading your data. For example by using these transforms (using CIFAR10 as an example here which comes with 3x32x32 images too):

# transform for train data
transform_train = transforms.Compose([
    transforms.RandomResizedCrop(224),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                 std=[0.229, 0.224, 0.225])
    ])

# transform for test data
transform_test = transforms.Compose([
    transforms.Resize(224),
    transforms.ToTensor(),
    transforms.Normalize(mean=[0.485, 0.456, 0.406],
                                 std=[0.229, 0.224, 0.225])
    ])

# load data and apply transforms
train_data = datasets.CIFAR10('data', train=True,
                              download=True, transform=transform_train)
test_data = datasets.CIFAR10('data', train=False,
                             download=True, transform=transform_test)


Both, transforms.RandomResizedCrop(224) and transforms.Resize(224) give the desired size. (the random cropping is applied as data augmentation to further diversify training data) You will find more details on available transforms in the PyTorch documentation.

As a side note: the size requirement is the same for all pre-trained models in PyTorch - not just Resnet18:


  All pre-trained models expect input images normalized in the same way, i.e. mini-batches of 3-channel RGB images of shape (3 x H x W), where H and W are expected to be at least 224. The images have to be loaded in to a range of [0, 1] and then normalized using mean = [0.485, 0.456, 0.406] and std = [0.229, 0.224, 0.225].