Closed spalaciob closed 6 years ago
@spalaciob thanks for catching this. What version of cleverhans are you using? My guess is that you are using cleverhans 2, which was released a few days ago. I have not had time to step through this repository and update all of the code to go along with cleverhans 2. For the time being, I will likely update the requirements.txt file to require cleverhans == 1.0.0. If you'd like to step through and help out, I'd be happy to look through your changes and merge.
Found a better way to solve the problem :)
Keras has a global variable to tell whether it's on training or testing mode (K.training_phase
in case someone's wondering).
Setting it to 0 (testing mode) solves the issue.
Pull request has been sent already.
Thanks for the PR. Closing this issue for now.
Following the README, trying to execute:
python craft_adv_samples.py -d=mnist -a=fgsm
got me the following error:It seems that the cleverhans function
batch_eval
needs the dropout layers to be explicitely turned off. For the specific case of the tutorial, modifyingsrc/attacks.py
in line 185 as follows:solves the problem.
I suppose that other models won't necessarily have that exact name for their dropout layers (haven't tested them) so I can't really vouch for this solution as an always working patch.