From 10f4112ffecd658281711bfa86105b72aa9e4fbd Mon Sep 17 00:00:00 2001 From: Andrew White Date: Mon, 27 Jul 2026 07:32:34 -0500 Subject: [PATCH] fix(eval-sde-adv): classifier not switched to eval mode (+1 more) --- eval_sde_adv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval_sde_adv.py b/eval_sde_adv.py index c14ffbd..766ed08 100644 --- a/eval_sde_adv.py +++ b/eval_sde_adv.py @@ -112,7 +112,7 @@ def eval_autoattack(args, config, model, x_val, y_val, adv_batch_size, log_dir): # ---------------- apply the attack to classifier ---------------- print(f'apply the attack to classifier [{args.lp_norm}]...') - classifier = get_image_classifier(args.classifier_name).to(config.device) + classifier = get_image_classifier(args.classifier_name).to(config.device).eval() adversary_resnet = AutoAttack(classifier, norm=args.lp_norm, eps=args.adv_eps, version=attack_version, attacks_to_run=attack_list, log_path=f'{log_dir}/log_resnet.txt', device=config.device) @@ -166,7 +166,7 @@ def eval_stadv(args, config, model, x_val, y_val, adv_batch_size, log_dir): # apply the attack to resnet print(f'apply the stadv attack to resnet...') - resnet = get_image_classifier(args.classifier_name).to(config.device) + resnet = get_image_classifier(args.classifier_name).to(config.device).eval() start_time = time.time() init_acc = get_accuracy(resnet, x_val, y_val, bs=adv_batch_size)