Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input aware dynamic backdoor error #176

Closed
GorkaAbad opened this issue Nov 4, 2022 · 5 comments
Closed

Input aware dynamic backdoor error #176

GorkaAbad opened this issue Nov 4, 2022 · 5 comments

Comments

@GorkaAbad
Copy link

Hi!,
I wanted to know if when using the --attack input_aware_dynamic I also should provide some mask parameters. I assume that I don't have to since the trigger should be included throughout the image.

I'm running this:
python examples/backdoor_attack.py --color --verbose 1 --dataset cifar100 --model vgg11_bn --attack input_aware_dynamic --save --download --poison_percent 0.001 --epochs 100 --pretrained --output 1 --dataset_normalize --train_mask_epochs 1 --attack_dir res/

But I keep getting this error in /trojanvision/attacks/backdoor/dynamic/input_aware_dynamic.py", line 378, in attack:
UnboundLocalError: local variable 'loss_div' referenced before assignment

Thanks in advance.

@ain-soph
Copy link
Owner

ain-soph commented Nov 4, 2022

Are you using the most up-to-date code?

@GorkaAbad
Copy link
Author

Yes, I think so. I just installed the latest version from GitHub today.

@ain-soph
Copy link
Owner

ain-soph commented Nov 4, 2022

Just commit a fix. Could you please try whether it works?

@GorkaAbad
Copy link
Author

Thanks for the fast response. Yes, that problem its solved now.

@ain-soph
Copy link
Owner

ain-soph commented Nov 4, 2022

Thanks for your report. The error is raised because of the low poison percent and there might be no poisoning data in a batch. I previously didn't take that into consideration.

@ain-soph ain-soph closed this as completed Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants