FederatedScope icon indicating copy to clipboard operation
FederatedScope copied to clipboard

Backdoor example

Open dalqattan opened this issue 2 years ago • 1 comments

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

dalqattan avatar May 18 '23 09:05 dalqattan

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

Osier-Yi avatar May 18 '23 12:05 Osier-Yi