ModelCheckpoint with multiple validation dataloaders #6664
Answered
by
awaelchli
kkirtac
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
-
Hi all. How can one make ModelCheckpoint work with multiple val dataloaders? Currently, it receives a single monitor parameter. I would like to make the checkpointing happen only when both dataloaders show improvement. Should I subclass ModelCheckpoint to receive a monitor per dataloader? |
Beta Was this translation helpful? Give feedback.
Answered by
awaelchli
Apr 5, 2021
Replies: 1 comment
-
You can compute the min or max (depending if your improvement is a decreasing or increasing metric) of both metrics and use self.log to log that combined value. Then, you only have one monitor for both and save_top_k can work on that. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
carmocca
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can compute the min or max (depending if your improvement is a decreasing or increasing metric) of both metrics and use self.log to log that combined value. Then, you only have one monitor for both and save_top_k can work on that.