mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-26 13:00:58 +08:00
auto state-dict and remove the way the model is loaded during hpc
This commit is contained in:
1 parent
ff1ed9db7e
commit
e2c7fa44b7
2 files changed
+16
-5
No files matched your search
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user