Please check your script. I suspect you have something like:
data_transforms = {
    'train': transforms.Compose([
        transforms.RandomResizedCrop(224),
        transforms.RandomHorizontalFlip(),
        transforms.ToTensor(),
        transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
    ]),
    'val': transforms.Compose([
        transforms.Resize(256),
        transforms.CenterCrop(224),
        transforms.ToTensor(),
        transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
    ]),
}

RandomResizedCrop(224) line constructs a 224x224 random crop from your image.
You need to set this for training to  transforms.RandomResizedCrop(299) and for ‘val’ part
transforms.Resize(342), transforms.CenterCrop(299),
Please note that I have assumed that you have got your code from https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html 22 .