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

errors regarding the POR attack #27

Open
nick-jia opened this issue Sep 27, 2023 · 0 comments
Open

errors regarding the POR attack #27

nick-jia opened this issue Sep 27, 2023 · 0 comments

Comments

@nick-jia
Copy link

Here is the code I'm trying to run (a slight modification version of the demo provided):

import openbackdoor as ob
from openbackdoor import load_dataset

victim = ob.PLMVictim(model="bert", path="bert-base-uncased")
attacker = ob.attackers.PORAttacker()
poison_dataset = load_dataset(name="sst-2")
victim = attacker.attack(victim, poison_dataset)
target_dataset = load_dataset(name="sst-2")
attacker.eval(victim, target_dataset)

1. Signature of method 'PORPoisoner.call()' does not match signature of base method in class 'Poisoner'
Line 67 in openbackdoor/attackers/poisoners/por_poisoner.py: def __call__(self, model, data: Dict, mode: str)
However,
Line 57 in openbackdoor/attackers/poisoners/poisoner.py, def __call__(self, data: Dict, mode: str)

This will lead to TypeError: __call__() takes 3 positional arguments but 4 were given when using the PORPoisoner

After modifying the signature, I got the following errors:

2. AttributeError: 'PLMVictim' object has no attribute 'save'
This is at line 36, in openbackdoor/attackers/por_attacker.py.

3. TypeError: 'NoneType' object is not subscriptable
line 37, openbackdoor/attackers/por_attacker.py

I'm not sure if these are bugs or I'm not using the PORAttacker in the designed way. Could the authors of this repo provide a minimal working example for the PORAttacker?

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

1 participant