Closed Mark-Dou closed 1 year ago
Hi Mark-Dou,
the reason is that the config is missing a run path to a trained model on Weights & Biases. You first need to train your target (and an evaluation model) on your dataset. Simply follow the instructions at https://github.com/LukasStruppek/Plug-and-Play-Attacks#train-target-models. If you use WandB for logging, you can simply copy and paste the run paths of your trained models, replace the "XXXXXXXXX" in the configuration file and then you can run the attack. Alternatively, you can also provide a local path to your model weights, see the default_attacking_local.yaml file.
Best, Lukas
If you want to use the models from our paper, you can download them directly from GitHub under the ICML release. Then simply adjust the attack config for the local files.
Thanks a lot, Lukas! I have solved this problem according to your suggestions.
I followed all the instructions in README.md. When i run python attack.py -c configs/attacking/CelebA_FFHQ.yaml in the docker container,
Find initial style vector w: 0%| | 0/5000 [00:00<?, ?it/s]
Traceback (most recent call last):
File "attack.py", line 465, in
such errors appeared, I have no idea on the reason. Could you give me some suggestions? Thank you very much~
Hmm, that seems to be a problem with the CUDA version and StyleGAN2. I know that other people had also some problems with training a StyleGAN2 and the PyTorch version. You could try to downgrade PyTorch to 1.8.1. However, I just tested it with the provided Docker file and it worked without any problems. My PyTorch version is 1.10.0a0+3fd9dcf.
Maybe also have a look at the official StyleGAN2-Ada Repo and the issues there.
Thanks for your excellent work. When I execute
python attack.py -c configs/attacking/CelebA_FFHQ.yaml
`Traceback (most recent call last): File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/normalize.py", line 25, in wrapper return func(*args, **kwargs) File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/public.py", line 880, in run self._runs[path] = Run(self.client, entity, project, run_id) File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/public.py", line 1720, in init self.load(force=not _attrs) File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/public.py", line 1824, in load raise ValueError("Could not find run %s" % self) ValueError: Could not find run <Run model_inversion_targets_facescrub/XXXXXXXXX/XXXXXXXXX (not found)>
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "attack.py", line 455, in
main()
File "attack.py", line 67, in main
target_model = config.create_target_model()
File "/data/users/zihanliu/hanyiwang/paper_code/MIAs/Plug-and-Play-Attacks/utils/attack_config_parser.py", line 26, in create_target_model
model = load_model(self._config['wandb_target_run'])
File "/data/users/zihanliu/hanyiwang/paper_code/MIAs/Plug-and-Play-Attacks/utils/wandb.py", line 21, in load_model
run = api.run(run_path)
File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/normalize.py", line 65, in wrapper
raise CommError(message, err).with_traceback(sys.exc_info()[2])
File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/normalize.py", line 25, in wrapper
return func(*args, **kwargs)
File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/public.py", line 880, in run
self._runs[path] = Run(self.client, entity, project, run_id)
File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/public.py", line 1720, in init
self.load(force=not _attrs)
File "/data/users/zihanliu/lib/anaconda3/envs/torch/lib/python3.8/site-packages/wandb/apis/public.py", line 1824, in load
raise ValueError("Could not find run %s" % self)
wandb.errors.CommError: Could not find run <Run model_inversion_targets_facescrub/XXXXXXXXX/XXXXXXXXX (not found)>
` such errors raised. How can I solve this problem? Thank you~