Closed ajsanjoaquin closed 3 years ago
Could you try using MNIST dataset to run the Single Pixel Attack tutorial in tutorials
? Single Pixel Attack is a demo intended for the MNIST dataset. The diversity of different datasets preprocessing limits the versatility.
Yes, it works for MNIST. Thanks. Although it would be good if there was a note in the attacks README that states which attacks are currently demos.
I get an
Assertion Error
when trying to run the Single Pixel Attack. Apparently, axes length must be equal to 2 (H, W), but my axes length is equal to 3 (B, H, W). I tried squeezing my img_tensor (3, 244, 244) but thepredict
method breaks. I tried removing the Assertion statement but creates an Index error.Can anyone tell me how to properly use the Single Pixel Attack? I followed the same method as shown in the FGSM notebook example written in Pytorch.
Code to reproduce: