trainer.test() does not return anything #9698
Unanswered
thistlillo
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
only logged metrics are returned def test_epoch_end(self, outputs):
avg_loss = torch.stack([x['test_batch_loss'] for x in outputs]).mean()
avg_acc = torch.stack([x['test_batch_acc'] for x in outputs]).mean()
self.log_dict({'test_loss': avg_loss, 'test_acc': avg_acc}) if you don't want to log it inside the logger, then use |
Beta Was this translation helpful? Give feedback.
0 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.
Uh oh!
There was an error while loading. Please reload this page.
-
My model
test
methods are as follows:The model is trained then tested with:
The data module returns three dataloaders (different): training, validation and test.
But
results
is empty, when it should not. According to the documentation here,trainer.test()
:Actual output from my code is:
As you can see, results from
trainer.test()
is empty.What did I fail to understand? For sure, I do not understand the initial
LightningDeprecationWarning
.Beta Was this translation helpful? Give feedback.
All reactions