mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-10-26 13:00:58 +08:00
fixed hpc save, load. cleaned apu
This commit is contained in:
1 parent
265411572f
commit
64de447545
1 file changed
+3
-4
@@ -108,13 +108,12 @@ class LightningModule(GradInformation, ModelIO, ModelHooks):
|
||||
else:
|
||||
checkpoint = torch.load(weights_path, map_location=lambda storage, loc: storage)
|
||||
|
||||
# load the state_dict on the model automatically
|
||||
model = cls(hparams)
|
||||
model.load_state_dict(checkpoint['state_dict'])
|
||||
|
||||
# give model a chance to load something
|
||||
model.load_model_specific(checkpoint)
|
||||
|
||||
# load the state_dict on the model automatically
|
||||
model.load_state_dict(checkpoint['state_dict'])
|
||||
model.on_load_checkpoint(checkpoint)
|
||||
|
||||
return model
|
||||
|
||||
|
||||
Reference in new issue
Block a user