Skip to content

Commit 8c286e1

Browse files
committed
Only skip logging internal LightningCLI params
1 parent af47ff4 commit 8c286e1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lightning/pytorch/loggers/utilities.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ def _log_hyperparams(trainer: "pl.Trainer") -> None:
6969
lightning_hparams = pl_module.hparams_initial
7070
inconsistent_keys = []
7171
for key in lightning_hparams.keys() & datamodule_hparams.keys():
72-
if key.startswith("_"):
73-
# Prevent merging LightningCLI's internal hparams and discourage of private param names
72+
if key in {"_class_path", "_instantiator"}:
73+
# Prevent merging LightningCLI's internal hparams
74+
lightning_hparams.pop(key)
75+
datamodule_hparams.pop(key)
7476
continue
7577
lm_val, dm_val = lightning_hparams[key], datamodule_hparams[key]
7678
if (

0 commit comments

Comments
 (0)