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

How to implement 'all-to-all' attack settings? #2

Closed
HeBangYan opened this issue Jun 21, 2022 · 2 comments
Closed

How to implement 'all-to-all' attack settings? #2

HeBangYan opened this issue Jun 21, 2022 · 2 comments

Comments

@HeBangYan
Copy link

Many thanks for your excellent work! 😁

Now I have a question. When I used the following setting in Blended Attack.

attack_label_trans: all2all
attack_label_shift_amount: 1
num_classses: 10

But I ran into the following error.

Traceback (most recent call last):
  File "./attack/laser_attack.py", line 347, in <module>
    main()
  File "./attack/laser_attack.py", line 212, in main
    adv_train_ds = prepro_cls_DatasetBD(
  File "./backdoorbench/attack/../utils/bd_dataset.py", line 63, in __init__
    assert len(poison_idx) == len(full_dataset_without_transform)
AssertionError

Did I do something wrong? Looking forward to your reply.

@CHR-ray
Copy link
Collaborator

CHR-ray commented Jun 21, 2022

  1. I am sorry to say that, for the all-to-all attack, we only have done the basic implementation early in the bd_attack_generate.py file. We haven't done a comprehensive compatibility test for every attack method. So you may meet a problem with some attack methods.
  2. I tried your setting in the blended attack. What I have done is replace the corresponding hyper-parameters in the YAML file. But I do not meet your problem. And I see that in your traceback information, it shows you are using the "./attack/laser_attack.py" script, so I am not sure how the problem comes. If you can offer more about your script, I can help you more.

@HeBangYan
Copy link
Author

I run 'all-to-all' settings by commenting out 'attack_target'.

I'm sorry I disturbed you. 😣

amp: False
device: cuda:0
attack_label_trans: all2all
# attack_target: 0
attack_label_shift_amount: 1
num_classses: 10

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