From: Francois Fleuret Date: Mon, 26 Jun 2017 15:40:25 +0000 (+0200) Subject: Minor bug fix. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=a25efec7618acd54806bd6ce69b30d473b7845f8;p=pysvrt.git Minor bug fix. --- diff --git a/cnn-svrt.py b/cnn-svrt.py index 0091aba..966ea4a 100755 --- a/cnn-svrt.py +++ b/cnn-svrt.py @@ -355,7 +355,8 @@ def nb_errors(model, data_set, mistake_filename_pattern = None): img = input[i].clone() img.sub_(img.min()) img.div_(img.max()) - filename = mistake_filename_pattern.format(b + i, target[i]) + k = b * data_set.batch_size + i + filename = mistake_filename_pattern.format(k, target[i]) torchvision.utils.save_image(img, filename) print(Fore.RED + 'Wrote ' + filename + Style.RESET_ALL) return ne