-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfeatureIs an improvement or enhancementIs an improvement or enhancement
Milestone
Description
🐛 Bug
Calling pl_module.log(...) within a Callback fails, even though this is recommended by the documentation here: https://pytorch-lightning.readthedocs.io/en/latest/loggers.html#logging-from-a-callback
Error
File "my_callback_file.py", line XX, in on_validation_epoch_end
pl_module.log_dict(my_metrics_dict)
File "/home/local/USHERBROOKE/pain5474/opt/miniconda3/envs/cav/lib/python3.8/site-packages/pytorch_lightning/core/lightning.py", line 287, in log_dict
self.log(
File "/home/local/USHERBROOKE/pain5474/opt/miniconda3/envs/cav/lib/python3.8/site-packages/pytorch_lightning/core/lightning.py", line 233, in log
self._results.log(
File "/home/local/USHERBROOKE/pain5474/opt/miniconda3/envs/cav/lib/python3.8/site-packages/pytorch_lightning/core/step_result.py", line 171, in log
self.__set_meta(
File "/home/local/USHERBROOKE/pain5474/opt/miniconda3/envs/cav/lib/python3.8/site-packages/pytorch_lightning/core/step_result.py", line 217, in __set_meta
_internal = self['meta']['_internal']
KeyError: '_internal'
python-BaseException
This is happening on master
Expected behavior
We can log from callbacks using the lightning module
Environment
Happening on PyTorch Lightning master
awaelchli and jbohnslav
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfeatureIs an improvement or enhancementIs an improvement or enhancement