Open j07nikita opened 5 years ago
"torch.save(model.state_dict(), "Models/RES50.pth")" In that, we need to define the class 'myModel' in order to create 'model' object. Could you please share the script how to define a model class? Thank in advance!
To save a model, you can use the following snippet:
torch.save(model.state_dict(), "Models/RES50.pth")
Here, I save my model in the directory
Models
with the nameRES50
While evaluation, you can load your model using the following:
Here, I initialized my model and then loaded the parameters of the model
RES50
which was lying in the directoryModels
.Hope that helps!