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

demo_attack run error #35

Open
newworldd opened this issue Nov 14, 2024 · 0 comments
Open

demo_attack run error #35

newworldd opened this issue Nov 14, 2024 · 0 comments

Comments

@newworldd
Copy link

Important data file "/usr/local/lib/python3.10/dist-packages/OpenHowNet/HowNet_dict_complete" lost, please run OpenHowNet.download().
0%| | 0/11915 [00:02<?, ?it/s]
Traceback (most recent call last):
File "/home/pentest/work/OpenBackdoor-main/demo_attack.py", line 63, in
main(config)
File "/home/pentest/work/OpenBackdoor-main/demo_attack.py", line 43, in main
backdoored_model = attacker.attack(victim, poison_dataset, config)
File "/home/pentest/work/OpenBackdoor-main/openbackdoor/attackers/lws_attacker.py", line 166, in attack
poison_datasets = wrap_dataset_lws({'train': data['train']}, self.poisoner.target_label, model.tokenizer, self.poisoner_config['poison_rate'])
File "/home/pentest/work/OpenBackdoor-main/openbackdoor/data/data_utils.py", line 26, in wrap_dataset_lws
return wrap_util(dataset, target_label, tokenizer, poison_rate)
File "/home/pentest/work/OpenBackdoor-main/openbackdoor/data/lws_utils.py", line 289, in wrap_util
datasets[key] = prepare_dataset_parallel(dataset[key], poison_rate, train=(key == 'train'))
File "/home/pentest/work/OpenBackdoor-main/openbackdoor/data/lws_utils.py", line 118, in prepare_dataset_par allel
dataset = prepare_dataset_for_self_learning_bert(dataset, poison_rate, train)
File "/home/pentest/work/OpenBackdoor-main/openbackdoor/data/lws_utils.py", line 62, in prepare_dataset_for_ self_learning_bert
cands = get_candidates_sememe(sentence, tokenizer, MAX_CANDIDATES)
File "/home/pentest/work/OpenBackdoor-main/openbackdoor/data/lws_utils.py", line 212, in get_candidates_seme me
tags = pos_tag_wordnet(words)
File "/home/pentest/work/OpenBackdoor-main/openbackdoor/data/lws_utils.py", line 199, in pos_tag_wordnet
pos_tagged_text = nltk.pos_tag(text)
File "/usr/local/lib/python3.10/dist-packages/nltk/tag/init.py", line 168, in pos_tag
tagger = _get_tagger(lang)
File "/usr/local/lib/python3.10/dist-packages/nltk/tag/init.py", line 110, in _get_tagger
tagger = PerceptronTagger()
File "/usr/local/lib/python3.10/dist-packages/nltk/tag/perceptron.py", line 183, in init
self.load_from_json(lang)
File "/usr/local/lib/python3.10/dist-packages/nltk/tag/perceptron.py", line 274, in load_from_json
with open(loc + TAGGER_JSONS[lang]["weights"]) as fin:
TypeError: unsupported operand type(s) for +: 'ZipFilePathPointer' and 'str'

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