From e961f7e3449aebadb7bb585a693fbb9fc1e2adea Mon Sep 17 00:00:00 2001 From: Peter Yu <2057325+yukw777@users.noreply.github.com> Date: Wed, 13 May 2020 17:29:54 -0400 Subject: [PATCH] args should come after the last positional argument (#1807) --- pytorch_lightning/core/lightning.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/core/lightning.py b/pytorch_lightning/core/lightning.py index 6e0db93e2e..46f6a11b95 100644 --- a/pytorch_lightning/core/lightning.py +++ b/pytorch_lightning/core/lightning.py @@ -1439,11 +1439,12 @@ class LightningModule(ABC, DeviceDtypeModuleMixin, GradInformation, ModelIO, Mod def load_from_checkpoint( cls, checkpoint_path: str, + *args, map_location: Optional[Union[Dict[str, str], str, torch.device, int, Callable]] = None, hparams_file: Optional[str] = None, tags_csv: Optional[str] = None, # backward compatible, todo: remove in v0.9.0 hparam_overrides: Optional[Dict] = None, - *args, **kwargs + **kwargs ) -> 'LightningModule': r""" Primary way of loading a model from a checkpoint. When Lightning saves a checkpoint