print(len(index)) mean_vals = [0.485, 0.456, 0.406] std_vals = [0.229, 0.224, 0.225] cam_thr_list = [0.0, 0.1, 0.12, 0.14] # thr = [100, 0, 20, 40, 60, 80, 120, 140, 160, 180, 200] thr = [100] for aa, thr in enumerate(thr): # for step, threshold in enumerate(cam_thr_list): threshold = 0.12 params = list(net.parameters()) net.train(False) net.eval() with torch.no_grad(): top1 = Metric.AverageEpochMeter('Top-1 Classification Acc') top5 = Metric.AverageEpochMeter('Top-5 Classification Acc') GT_loc = Metric.AverageEpochMeter('Top-1 GT-Known Localization Acc') top1_loc = Metric.AverageEpochMeter('Top-1 Localization Acc') top5_loc = Metric.AverageEpochMeter('Top-5 Localization Acc') progress = Metric.ProgressEpochMeter( len(test_loader), [top1, top5, top1_loc, top5_loc, GT_loc], prefix="\nValidation Phase: ") gt_file = './CUB_datalist/test_bounding_box.txt' f = open(gt_file, 'r') net.eval() for i, (img_path, image_tensor, image_level) in enumerate(test_loader): image_tensor = image_tensor.cuda(non_blocking=True) image_level = image_level.cuda(non_blocking=True) logit, _ = net(image_tensor)