-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
🐛 Bug
The "outputs" argument of the 'on_train_batch_end' method of a lightning Callback seems to be empty, unless training_epoch_end() is implemented in the lightning model.
I'm looking for a way to process the outputs of training_step() in a callback. If I'm not mistaken, the "outputs" argument of the on_train_batch_end() of a lightning callback is meant for use cases like this. If I don't implement the training_epoch_end() method in my lightning model, the "outputs" argument is consistently an empty list. Implementing training_epoch_end() does fill the "outputs" argument with the output of training_step(), but I'd like to avoid this, as keeping track of all the training_step outputs for an entire epoch might be memory intensive.
Reproducing the issue
To Reproduce
The following link BoringModel contains the behaviour I'm referring to.
Expected behavior
The "outputs" argument of the on_train_batch_end() method of a lightning callback is an empty list if one comments out train_epoch_end() in the lightning model.
Environment
- CUDA:
- GPU:
- Tesla T4
- available: True
- version: 10.1
- GPU:
- Packages:
- numpy: 1.19.5
- pyTorch_debug: True
- pyTorch_version: 1.7.0+cu101
- pytorch-lightning: 1.1.4
- tqdm: 4.41.1
- System:
- OS: Linux
- architecture:
- 64bit
- processor: x86_64
- python: 3.6.9
- version: Proposal for help #1 SMP Thu Jul 23 08:00:38 PDT 2020
Additional context
If this is a feature rather than a bug, how do you recommend we use the outputs of training_step in a callback without having to track all training_step outputs for an entire epoch?