question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

give "validation sanity check" flag for "validation_epoch_end" & "validation_step"

See original GitHub issue

🚀 Feature

Motivation

When using some custom saver, logger in validation function (validation_epoch_end, validation_step), with Trainer.fit(), it always execute validation sanity check so mess log comes out.

Pitch

def validation_step(self, batch, batch_nb, sanity_check):
   if sanity_check:
      ...
def validation_epoch_end(self, outputs, sanity_check):
   if sanity_check:
      ...

or

def validation_step(self, batch, batch_nb):
   if self.sanity_check:
      ...
def validation_epoch_end(self, outputs):
   if self.sanity_check:
      ...

Alternatives

None

Additional context

None

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:11
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

10reactions
AtomScottcommented, Feb 8, 2021

@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.

6reactions
ZhaofengWucommented, Dec 23, 2020

Nvm, found this flag trainer.running_sanity_check.

Read more comments on GitHub >

github_iconTop Results From Across the Web

give "validation sanity check" flag for "validation_epoch_end ...
When using some custom saver, logger in validation function ( validation_epoch_end , validation_step ), with Trainer.fit(), it always execute ...
Read more >
Validation sanity check - LightningModule - Lightning AI
Hi, I am new to pytorch lightning. Can someone explain what is validation sanity check ? Thanks in advance!
Read more >
Validation - Sanity.io
Validation. Describes how to validate documents within the content studio. Sanity Studio allows you to specify validation rules on your document types and ......
Read more >
PyTorch Lightning - num sanity val steps - YouTube
In this video, we give a short intro to Lightning's flag 'num_sanity_val_steps.'To learn more about Lightning, please visit the official ...
Read more >
Trainer — PyTorch Lightning 1.8.5.post0 documentation
Running the training, validation and test dataloaders. Calling the Callbacks at ... Sanity check runs n batches of val before starting the training...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found