Closed akshayag closed 5 years ago
Hi, @akshayag! Thanks for letting us know! I'll add a small tolerance constant to avoid divide by 0 warnings.
Please write some instructions to use other attack methods also. For example, I am getting the error when trying to run the attack CarliniL2Method
x_train_adv = adv_crafter.generate(x_train) File "/adversarial-robustness-toolbox-master/art/attacks/carlini.py", line 124, in generate assert not (self.targeted and y is None) AssertionError
Similarly, if there will be an example line for other methods also to craft the adversary.
We will try to provide more examples. Meanwhile, for your current error, as per CarliniL2Method documentation, you either need to set targeted=False
when creating the attack, or provide target labels y
when calling generate
.
Please take a look at this error also.
Create VirtualAdversarialMethod attack
Craft attack on training examples /adversarial-robustness-toolbox-master/art/attacks/virtual_adversarial.py:91: RuntimeWarning: invalid value encountered in float_scalars d_new[array_iter.multi_index] = (kl_div2 - kl_div1) / self.finite_diff /adversarial-robustness-toolbox-master/art/attacks/virtual_adversarial.py:116: RuntimeWarning: invalid value encountered in multiply x = x * inverse
@akshayag Fix for both divide by 0 issues is pushed. Please confirm that the warning is gone.
Hello,
Was running the code on CIFAR for 150 epochs and with batch size 32
Craft attack on training examples /adversarial-robustness-toolbox-master/art/attacks/deepfool.py:84: RuntimeWarning: divide by zero encountered in true_divide r = (abs(f_diff[l]) / pow(np.linalg.norm(grad_diff[l]), 2)) grad_diff[l] /adversarial-robustness-toolbox-master/art/attacks/deepfool.py:84: RuntimeWarning: invalid value encountered in multiply r = (abs(f_diff[l]) / pow(np.linalg.norm(grad_diff[l]), 2)) grad_diff[l]