Skip to content

Commit 4dc77b5

Browse files
authored
Change lightning module params to dict when loading (#1639)
* change module params to dict * tiny change * reverse
1 parent 210cd65 commit 4dc77b5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pytorch_lightning/core/lightning.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1550,8 +1550,9 @@ def _load_model_state(cls, checkpoint: Dict[str, Any], *args, **kwargs) -> 'Ligh
15501550
)
15511551

15521552
# load the state_dict on the model automatically
1553-
model_args = [hparams] if hparams else []
1554-
model = cls(*model_args, *args, **kwargs)
1553+
if hparams:
1554+
kwargs.update(hparams=hparams)
1555+
model = cls(*args, **kwargs)
15551556
model.load_state_dict(checkpoint['state_dict'])
15561557

15571558
# give model a chance to load something

0 commit comments

Comments
 (0)