From b1ef41f60a44ce9a97efac788dc639c48b0c40e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Wed, 6 Apr 2022 19:01:12 +0200 Subject: [PATCH] fix val accuracy printing in lite example (#12632) --- .../basic_examples/mnist_examples/image_classifier_2_lite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl_examples/basic_examples/mnist_examples/image_classifier_2_lite.py b/pl_examples/basic_examples/mnist_examples/image_classifier_2_lite.py index 4240a9b7c4..db310b8280 100644 --- a/pl_examples/basic_examples/mnist_examples/image_classifier_2_lite.py +++ b/pl_examples/basic_examples/mnist_examples/image_classifier_2_lite.py @@ -126,7 +126,7 @@ class Lite(LightningLite): # all_gather is used to aggregated the value across processes test_loss = self.all_gather(test_loss).sum() / len(test_loader.dataset) - print(f"\nTest set: Average loss: {test_loss:.4f}, Accuracy: ({test_acc.compute():.0f}%)\n") + print(f"\nTest set: Average loss: {test_loss:.4f}, Accuracy: ({100 * test_acc.compute():.0f}%)\n") test_acc.reset() if hparams.dry_run: