auto state-dict and remove the way the model is loaded during hpc

This commit is contained in:
William Falcon
2019-07-26 21:37:06 -04:00
parent ff1ed9db7e
commit e2c7fa44b7
2 changed files with 16 additions and 5 deletions
+5 -2
View File
@@ -110,9 +110,12 @@ class LightningModule(GradInformation, ModelIO, ModelHooks):
model = cls(hparams)
# allow model to load
# give model a chance to load something
model.load_model_specific(checkpoint)
model.load_state_dict(checkpoint['state_dict'], strict=False)
# load the state_dict on the model automatically
model.load_state_dict(checkpoint['state_dict'])
return model
def summarize(self):