Skip to content

Commit 2324f6f

Browse files
committed
change module params to dict
1 parent acfb054 commit 2324f6f

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
@@ -1548,8 +1548,9 @@ def _load_model_state(cls, checkpoint: Dict[str, Any], *args, **kwargs) -> 'Ligh
15481548
)
15491549

15501550
# load the state_dict on the model automatically
1551-
model_args = [hparams] if hparams else []
1552-
model = cls(*model_args, *args, **kwargs)
1551+
if hparams:
1552+
kwargs.update(hparams=hparams)
1553+
model = cls(*args, **kwargs)
15531554
model.load_state_dict(checkpoint['state_dict'])
15541555

15551556
# give model a chance to load something

0 commit comments

Comments
 (0)