ain-soph / trojanzoo

TrojanZoo provides a universal pytorch platform to conduct security researches (especially backdoor attacks/defenses) of image classification in deep learning.
https://ain-soph.github.io/trojanzoo
GNU General Public License v3.0
279 stars 63 forks source link

Question about experiment after pip install #153

Closed CHR-ray closed 2 years ago

CHR-ray commented 2 years ago

After pip install, can I run your attack/defense outside your repo folder? eg. directly type 'python -m xxxx' in terminal in any other folder path.

If it is possible, how to write the command in terminal and where those intermediate file would locate? (eg. pt file for weights saved during attack/defense, datasets used in your scripts, etc.)

ain-soph commented 2 years ago

Those things are in the configs. Please make sure you set things (eg, data_path) correctly.

You could modify user-level and workspace-level configs following

https://ain-soph.github.io/trojanzoo/trojanzoo/configs.html

https://ain-soph.github.io/trojanzoo/trojanvision/configs.html

Alternatively, you can pass command line arguments to set those configs as well for a one-time run.

ain-soph commented 2 years ago

Example config files https://github.com/ain-soph/trojanzoo/blob/main/trojanzoo/configs/dataset.yml

ain-soph commented 2 years ago

Any feedback @CHR-ray ? Otherwise, I’ll close this issue after 2 days.

CHR-ray commented 2 years ago

Sorry to reply late. So after pip install, I should change the config file in the place that package pip installed?

ain-soph commented 2 years ago

No, you should follow the pattern of those files and make your own configs at user level or workspace level as illustrated in https://github.com/ain-soph/trojanzoo/issues/153#issuecomment-1199520076

CHR-ray commented 2 years ago

I think I understand, thank you.