machine_learning_adversarial_examples icon indicating copy to clipboard operation
machine_learning_adversarial_examples copied to clipboard

InvalidArgumentError

Open yfoo opened this issue 7 years ago • 1 comments

Hi Rodgzilla! Nice notebook. I'm trying to apply a piece of your code to one i've been working with to classify faces. I'd like to use your adversarial example code but can't get it working yet. It could be due to my model being different. But here goes:

InvalidArgumentError (see above for traceback): You must feed a value for placeholder tensor 'dropout_1/keras_learning_phase' with dtype bool [[Node: dropout_1/keras_learning_phase = Placeholderdtype=DT_BOOL, shape=[], _device="/job:localhost/replica:0/task:0/cpu:0"]]

The above is from this code:

grad_values = get_grad_values([original_array])[0]

Thanks!

yfoo avatar May 01 '17 06:05 yfoo

Try to add this line before loading your model:

import keras.backend as K
K.set_learning_phase(1)

vfaramond avatar Sep 14 '17 11:09 vfaramond