I don’t know how you’ve created the model, but based on the error message I assume you are using a custom nn.Module with an internal resnet.
The raised error while loading the state_dict points towards an attribute name mismatch, i.e. while storing the state_dict it seems you’ve used the internal self.resnet attribute while the current model uses self.pretrained_model.resnet. You could either make sure to use the same model definition or change the keys in the state_dict manually.
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.