Hi,



 Mona_Jalal:

self.model = models.resnet18()


You just need to instantiate the desired model for instance self.model = HourGlass(args). Also, you need to load weights and state dict which you can find it here 2. (note that do not set model in eval mode)
But as you might know, in the following line,
        self.model.fc = nn.Linear(self.model.fc.in_features, num_classes)


the author replaces last linear layer to match their desired number of output classes. In your case, you need to find model definition (you can use this thread 3), and the change the appropriate layer based on the model definition.
Unfortunately I don’t know any implemenation of HourGlass.
Let me know if you had any troubles.
Bests