Harry24k / adversarial-attacks-pytorch

PyTorch implementation of adversarial attacks [torchattacks].
https://adversarial-attacks-pytorch.readthedocs.io/en/latest/index.html
MIT License
1.79k stars 337 forks source link

[BUG]if use pip install torchattacks, the DeepFool is wrong #153

Closed kld20092009 closed 1 year ago

kld20092009 commented 1 year ago

✨ Short description of the bug [tl;dr]

I think it is a problem with the version of attacks installed by pip.

💬 Detailed code and results

The code in DeepFool is incorrect. When the label is the maximum value, there will be an array overflow phenomenon.f_k = fs[wrong_classes] will make the array length -1, and it is wrong to overwrite value[lable] at this time. I see this has been fixed in the source code, but in pip is still wrong

rikonaka commented 1 year ago

Hi, what is the version of torchattacks you are using now?

kld20092009 commented 1 year ago

Hi, what is the version of torchattacks you are using now?

I use 3.4.1 now, and the version in PIP seems to be 3.4.0

rikonaka commented 1 year ago

I use 3.4.1 now, and the version in PIP seems to be 3.4.0

The version installed via pip is outdated, I suggest users install torchattacks from source. ☺️