-
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
give "validation sanity check" flag for "validation_epoch_end" & "validation_step" #1391
Comments
This could be addressed with the Trainer states: #1633 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@awaelchli I'm looking at #1633 and the merged PR #2541. What's the training state that corresponds to this usage? Is it |
Nvm, found this flag |
Is there a way to disable .log and .logger for the sanity step using the framework in an elegant way? |
@noamzilo how about we provide def on sanity_check_start(self):
self.logger.disable()
def on_sanity_check_end(self):
self.logger.enable() |
sounds great :) In this opportunity, I would like to raise a concern I found, not sure if I am doing something wrong: These are plotted using
( with
and a single sample per batch. This configuration should mean that the training loss should always equal the validation loss. However, as the graphs show (and I validated this with the debugger), the training loss lags by 1 epoch after the val loss, which appears as if the train loss is LARGER than the val loss, which raised my attention. using Am I doing something wrong? Did I find a bug? Initially, I thought this was due to the sanity epoch, but it seems this isn't the case. This happens on any data set I tried. |
@noamzilo @awaelchli has this been implemented? def on sanity_check_start(self):
self.logger.disable()
def on_sanity_check_end(self):
self.logger.enable() If not we shouldn't reopen this issue? This is a feature that I would use daily and also something were I had to write my own workaround so I don't mind getting my own hands dirty. |
@noamzilo @awaelchli Bumping this issue.... @ZhaofengWu how do you access this flag from a PL module? |
you can use |
It seems that the class CustomCallback(pl.Callback):
def __init__(self):
super().__init__()
def on_validation_epoch_end(self, trainer, module):
if not trainer.sanity_checking:
return
else:
# do something here This throws the following error. AttributeError: 'Trainer' object has no attribute 'running_sanity_check' |
Are you sure you didn't mistype |
🚀 Feature
Motivation
When using some custom saver, logger in validation function (
validation_epoch_end
,validation_step
), with Trainer.fit(), it always executevalidation sanity check
so mess log comes out.Pitch
or
Alternatives
None
Additional context
None
The text was updated successfully, but these errors were encountered: