Just load your model instead of models.resnet18.
This approach should work likewise for all models.
Of course you would have to load the state_dict of your custom model first, as you most likely don’t have the pretrained argument.