Skip to content

Commit

Permalink
fixed undesired behaviour due to dict.fromkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
ivannz committed May 25, 2020
1 parent 8ca8336 commit 21b14a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch_lightning/callbacks/lr_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def on_train_start(self, trainer, pl_module):
names = self._find_names(trainer.lr_schedulers)

# Initialize for storing values
self.lrs = dict.fromkeys(names, [])
self.lrs = {name: [] for name in names}

def on_batch_start(self, trainer, pl_module):
latest_stat = self._extract_lr(trainer, 'step')
Expand Down

0 comments on commit 21b14a7

Please sign in to comment.