I will try the above thanks .
Looks like the same error was solved using this method
model = resnet18(pretrained=True, num_classes=4)  # where num_classes will be different 
model.load_state_dict(checkpoint)  # load