Monitored metric from ModelCheckpoint does not match metric from validation_epoch_end #8083
Unanswered
Bunoviske
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment 3 replies
-
Hi, Do you by chance use the In general, averaging metrics like Accuracy and F1 Score is not accurate accumulation over batches, which is why in torchmetrics each |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello! Using the code below, I get different metric results for "val_accuracy". The monitored metric in ModelCheckpoint callback does some reduce function different from simple average (as done in val_epoch_end).
RESULTS
In this epoch I showed, the difference was really huge. Most of time, they are similar, but never equal. Besides that, when I log these results to WandB, the logging is exactly the same as ModelCheckpoint verbose.
As discussed here, I imagine that some weighted average over my batch samples is being applied, but since I expect variable sequences as input in the batch, this average is not helping me to get the actual best model.
Any clarification regarding this result difference is appreciated! Thanks!
Beta Was this translation helpful? Give feedback.
All reactions