Closed peck94 closed 5 years ago
Dear @peck94 thanks for the bug report! There was indeed a small issue in the backward function of the Keras model through which the last axis was squeezed out. Should be fixed.
Happy to help! fb05fb27bae5a4b2d2a1684a99c8eb1a300414a2 seems to fix it for me. Thank you!
Hello,
I suspect I may have encountered a bug in the implementation of the Carlini-Wagner L2 attack. Consider the following code:
This just creates a Keras model for MNIST and attempts to generate adversarials using either
CarliniWagnerL2Attack
orDeepFoolAttack
. When I run this code with DeepFool, everything seems to work perfectly. However, when I switch to CarliniWagnerL2, I get the following error:Upon further investigation, it seems
image.shape
is(28, 28, 1)
as one would expect butgradient.shape
is(10,)
for some reason. This error only seems to occur on MNIST or Fashion-MNIST. On CIFAR-10 and SVHN data sets the CarliniWagnerL2Attack appears to work fine. My Python version is 3.5.2, Keras version is 2.2.4 and Foolbox is version 1.8.0.Is this a bug or am I doing something wrong?