Skip to content

errors regarding the POR attack #27

@nick-jia

Description

@nick-jia

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions