Limit number of validation batches without resetting iterator #20727
Unanswered
jjh42
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a supported way in pytorch lightning trainer to limit the number of validation batches each validation cycle but not reset the iterator.
In my setup I'm measuring everything in steps rather than epochs, so I have val_check_interval=[some number of steps] but I don't want to go through the whole validation set, just a sample each time. limit_val_batches is close to what I want, but it resets the iterator each time. What I want is just to keep reading through the validation set each validation step.
I have a hacky workaround by wrapping the dataset in one that ignores the iterator.
Beta Was this translation helpful? Give feedback.
All reactions