How to change the Datamodule during training with a callback?
What is your question?
How to change the Datamodule during training with a callback?
More details:
I am looking for a way to reinitialized my Datamodule with different parameter, I am currently sending the height of my images as argument to my datamodule and I want to change this height at some point during training, the simple way is to call trainer.fit multiple times with different datamodules, but I am wondering is there a way to do this on callback, in the same way as you do when you change the optimizer or lr_scheduler?
Something similar to this:
def on_train_epoch_start(self, trainer, pl_module):
            sch = optim.lr_scheduler.StepLR(optimizer, 1, 0.96)
            scheduler = {
                'scheduler': sch,
                'interval': interval,  # or 'step'
                'monitor': 'train_loss',
                'reduce_on_plateau': False,
                'frequency': 1,
            }
            trainer.lr_schedulers = trainer.configure_schedulers([scheduler])