From: Francois Fleuret Date: Mon, 26 Jun 2017 13:46:03 +0000 (+0200) Subject: Update. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=3bdc76191e8d7a15648cc3602b18438c98fcb100;p=pysvrt.git Update. --- diff --git a/cnn-svrt.py b/cnn-svrt.py index 3fe50d8..0091aba 100755 --- a/cnn-svrt.py +++ b/cnn-svrt.py @@ -355,9 +355,9 @@ def nb_errors(model, data_set, mistake_filename_pattern = None): img = input[i].clone() img.sub_(img.min()) img.div_(img.max()) - torchvision.utils.save_image(img, - mistake_filename_pattern.format(b + i, target[i])) - + filename = mistake_filename_pattern.format(b + i, target[i]) + torchvision.utils.save_image(img, filename) + print(Fore.RED + 'Wrote ' + filename + Style.RESET_ALL) return ne ###################################################################### @@ -560,7 +560,7 @@ for problem_number in map(int, args.problems.split(',')): cuda = torch.cuda.is_available()) nb_test_errors = nb_errors(model, test_set, - mistake_filename_pattern = 'mistake_{:d}_{:06d}.png') + mistake_filename_pattern = 'mistake_{:06d}_{:d}.png') log_string('test_error {:d} {:.02f}% {:d} {:d}'.format( problem_number,