kabkabm / defensegan

Defense-GAN: Protecting Classifiers Against Adversarial Attacks Using Generative Models (published in ICLR2018)
Apache License 2.0
229 stars 62 forks source link

White box attack not working #6

Closed shubham-malaviya closed 5 years ago

shubham-malaviya commented 5 years ago

Hi, I'm getting error after running the whitbox.py with the configuration given in the Readme file . I got the error at line #210 "adv_x = attack_obj.generate(images_pl, **attack_params)". Please help me to solve this issue. Please note that blackbox.py is working fine. Here is the screenshot for the error.

whitebox_error

Thank you.

shubham-malaviya commented 5 years ago

I have solved the error. Seems like the problem was in the cleverhans Module. I changed a cleverhans/attack_tf.py file a little and everything worked fine. Lines to change/update are : LINE #63 in cleverhans/attack_tf.py grad = tf.gradients(loss, x) grad = [grads if grads is not None else tf.zeros(x.shape[1:],dtype=tf.float32) for grads in grad]

wuyunpeng666 commented 5 years ago

I have solved the error. Seems like the problem was in the cleverhans Module. I changed a cleverhans/attack_tf.py file a little and everything worked fine. Lines to change/update are : LINE #63 in cleverhans/attack_tf.py grad = tf.gradients(loss, x) grad = [grads if grads is not None else tf.zeros(x.shape[1:],dtype=tf.float32) for grads in grad] I got this problem long time.Thanks your method.