Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mixing hparams and arguments in LightningModule #1505

Merged
merged 9 commits into from
Apr 19, 2020
2 changes: 1 addition & 1 deletion pytorch_lightning/core/lightning.py
Original file line number Diff line number Diff line change
Expand Up @@ -1538,7 +1538,7 @@ def _load_model_state(cls, checkpoint: Dict[str, Any], *args, **kwargs) -> 'Ligh
# load the state_dict on the model automatically
model_args = [hparams] if hparams else []
if len(model_args) > 0:
model = cls(*model_args)
model = cls(*model_args, *args, **kwargs)
else:
model = cls(*args, **kwargs)
model.load_state_dict(checkpoint['state_dict'])
Expand Down