-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass epoch outputs to callback hooks on_validation_epoch_end
and on_test_epoch_end
#5508
Comments
Hi! thanks for your contribution!, great first issue! |
#4369 fixes it! |
No, it does not. #4369 fixes an existing bug in the hook This issue requests that the validation and test outputs should be passed to the respective hooks |
This issue has been automatically marked as stale because it hasn't had any recent activity. This issue will be closed in 7 days if no further activity occurs. Thank you for your contributions, Pytorch Lightning Team! |
@kaushikb11 @rsaite just curious, why didn't |
Using
or even (to avoid having to include this super call all the time)
Maybe there's a more elegant solution, but it always seems to require messing around with the implementation of the LightningModule. Ultimately, it's a design choice and from reading the Lightning documentation I got the impression that
|
I would also find this very helpful. |
It seems you can use the hook |
Yes, I think this is also what I ended up doing and (I realized that now) probably the preferred way.
As far as I understand, it's due to performance reasons when you don't want to cache all the outputs, see #7338 #7339. |
I would also find this very helpful. I have lots of codes that are analyze the output and plot and log. Those codes are not depending on specific models. It would be nice to pull them out as a callback (similar to what rsaite said above in #5508 (comment)) |
🚀 Feature
The callback hook
on_validation_epoch_end(self, trainer, pl_module)
should receive the outputs of the validation epoch, changing its signature toon_validation_epoch_end(self, trainer, pl_module, outputs)
, same for the hookon_test_epoch_end
. This functionality has already been implemented foron_train_epoch_end
.Motivation
I have different models where I want to do the same things with the validation/test outputs after each epoch: write predictions out to a dataframe and create plots based on the outputs. Separating this functionality from my modules by using a callback (instead of polluting all my modules with this code) seems to be the proper way.
This feature request is related to the open issues #4689 and #4369 concerning a bug in
on_train_epoch_end
.The text was updated successfully, but these errors were encountered: