vqa-outliers
vqa-outliers copied to clipboard
Potential Bug Report
Potential Bug
Hi, thanks for sharing the code. When I was trying to get the code running, I encountered the following error message:
pytorch_lightning.utilities.exceptions.MisconfigurationException: ModelCheckpoint(monitor='val_acc') not found in the returned metrics: ['train_epoch_loss', 'train_epoch_acc'].
HINT: Did you call self.log('val_acc', value) in the LightningModule?
I went through the code, and I think this might be related to the following block of code which is present in all the models. https://github.com/siddk/vqa-outliers/blob/9cb877ec6848301aec68dc31a2ebd121c521b33e/src/models/lstm_cnn.py#L268-L290
Specifically, I think the this line of code https://github.com/siddk/vqa-outliers/blob/9cb877ec6848301aec68dc31a2ebd121c521b33e/src/models/lstm_cnn.py#L290 should be changed to
for k, v in log.items():
self.log(k, v)
which is consistent with the implementation of training_epoch_end
and also fixes the error.
Moreover, the returns of validation_epoch_end
is not accessed in the source code of pytorch-lightning
. I also suppose that validation_epoch_end
should be symmetric to training_epoch_end
.
I wonder if my observation is correct. Looking forwarding to your replies~
Encountered the same bug while running dataset map with BUTD. And your solution fixed it. Thanks @Ja1Zhou!