Hello,
I have two datamodule let’s call them datamodule_train and datamodule_own_dataset
I would like to train on datamodule_train and evaluate every n epoch on the validation_set of datamodule_train AND the validation_set of datamodule_own_dataset and logs information from both validation_set.
How can I do it in a efficient way?
I can’t try to just get the train/testloaders and feed them to the trainer because they are in fact pytorch geometrics dataset and the transformation datamodule->train_dataloaders didn’t work.
I already tried to create some callback as a workaround:
class MyTrueCallback(pl.Callback):
def init(self,true_data):
self.true_data=true_datadef on_validation_epoch_end(self,trainer,pl_module):
trainer.validate(model=pl_module,datamodule=self.true_data)
return
but it failed on logging in the validation_loop of trainer trainer.validate(…) with this error:
self.log("val/miou", miou, prog_bar=True)
You are trying to
self.log()
but the loop’s result collection is not registered yet. This is most likely because you are trying to log in apredict
hook, but it doesn’t support logging