Skip to content

No Callbacks for Validation Batch Step - How To Get Progress of Validation? #1165

@0x6b756d6172

Description

@0x6b756d6172

🚀 Feature

The Callbacks has two functions on_batch_start and on_batch_end. The documentation and code execution shows that these are only called for training batches, not validaton (or test). I am building a Callback for my own logging/dashboarding via Streamlit and I have a requirement to track the progress of both the train batch steps and validation batch steps during training. I see that there is a validation progress bar in the console during training - how is this implemented (if not via a Callback)?

Current Code

class MyCallback(pl.Callback):
    def on_train_start(self, trainer, pl_module):
        self.train_batch_count = 0
        self.train_batch_total = len(trainer.train_dataloader)

    def on_batch_end(self, train, pl_module):
        self.train_batch_count += 1
        percent_complete = self.train_batch_count / self.train_batch_total
        # display on screen

    def on_epoch_end(self, train, pl_module):
        self.train_batch_count = 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs an improvement or enhancementhelp wantedOpen to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions