Open ZhipengHe opened 1 year ago
Hi @ZhipengHe Thank you very much for the detailed description of the issue! Please apologize my delayed response. It looks like the issue is that if in the last code segment in our message above for norm < 2
will result in 1 / perturbations^abs(norm)
. This creates the division by zero error of any element of perturbations
is zero. I think for norm < 2
we would have to add a check that perturbations
has to be larger than zero at all times.
Describe the bug
When using
art.attack.evasion.LowProFool
method, if I set parameternorm
in the range of $p \in (0, 2)$, the attack model will report ValueError.To Reproduce Steps to reproduce the behavior:
norm>=2
ornorm='inf'
, the attack model works well. For example,Result is :
0<norm<2
, the attack model doesn't work. For example,Error:
From
RuntimeWarning: divide by zero encountered in power
, InLowProFool
L307-L313 , the attack model initialized the perturbation withnp.zero
Initialize 'keep-the-best' variables.
best_norm_losses = np.inf * np.ones(samples.shape[0], dtype=np.float64) best_perturbations = perturbations.copy()
Expected behavior The attack model should also generate adversarial examples succuessfully.
System information (please complete the following information):