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

Backdoor example #603

Open
dalqattan opened this issue May 18, 2023 · 1 comment
Open

Backdoor example #603

dalqattan opened this issue May 18, 2023 · 1 comment

Comments

@dalqattan
Copy link

Hi
I couldn't run the backdoor example
python federatedscope/main.py --cfg scripts/attack_exp_scripts/backdoor_attack/backdoor_badnet_fedavg_convnet2_on_femnist.yaml

An error has raised

(fs) PS C:\temp\federatedscope> python federatedscope/main.py --cfg scripts/attack_exp_scripts/backdoor_attack/backdoor_badnet_fedavg_convnet2_on_femnist.yaml
Traceback (most recent call last):
File "C:\temp\federatedscope\federatedscope\main.py", line 28, in
init_cfg.merge_from_file(args.cfg_file)
File "c:\temp\federatedscope\federatedscope\core\configs\config.py", line 109, in merge_from_file
self.merge_from_other_cfg(cfg)
File "c:\temp\federatedscope\federatedscope\core\configs\config.py", line 124, in merge_from_other_cfg
_merge_a_into_b(cfg_other, self, self, [])
File "c:\temp\federatedscope\federatedscope\core\configs\yacs_config.py", line 526, in _merge_a_into_b
_merge_a_into_b(v, b[k], root, key_list + [k])
File "c:\temp\federatedscope\federatedscope\core\configs\yacs_config.py", line 543, in _merge_a_into_b
raise KeyError("Non-existent config key: {}".format(full_key))
KeyError: 'Non-existent config key: federate.local_update_steps'

Thanks

Duaa

@Osier-Yi
Copy link
Collaborator

Osier-Yi commented May 18, 2023

The backdoor attacks are on the branch of backdoor-bench. You can: switch to this branch and re-install federatedscope, and try the example yamls in scripts/backdoor_scripts/attack_config/

Try the following command:

git fetch

git switch backdoor-bench

pip install -e.

pip install opencv-python matplotlib pympler scikit-learn

python federatedscope/main.py --cfg scripts/backdoor_scripts/attack_config/backdoor_fedavg_convnet2_on_cifar10.yaml

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