Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eval_sde_adv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down