From 9b9824c7c19bf7e72df2d085d97b99b3bfb00ba4 Mon Sep 17 00:00:00 2001 From: Norman Mu Date: Tue, 13 Oct 2020 18:06:53 -0700 Subject: [PATCH] Avoid ImageNet-C evaluation every epoch --- imagenet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imagenet.py b/imagenet.py index 012b321..d88431a 100644 --- a/imagenet.py +++ b/imagenet.py @@ -482,11 +482,11 @@ def main(): '{:.2f}' .format((epoch + 1), train_loss_ema, test_loss, 100. * test_acc1)) - corruption_accs = test_c(net, test_transform) - for c in CORRUPTIONS: - print('\t'.join(map(str, [c] + corruption_accs[c]))) + corruption_accs = test_c(net, test_transform) + for c in CORRUPTIONS: + print('\t'.join(map(str, [c] + corruption_accs[c]))) - print('mCE (normalized by AlexNet):', compute_mce(corruption_accs)) + print('mCE (normalized by AlexNet):', compute_mce(corruption_accs)) if __name__ == '__main__':