You need to define the model before you load weight in the model. This definition has to match the values in the state dictionary. If you are using standard ResNet50 for ImageNet then you can do
import torchvision.models as models
model = models.resnet50()
and then load your state dictionary into the model