My code is:
i = 0
fgsm = FastGradientMethod(wrap)
adv = fgsm.generate(x_test_tensor, **fgsm_params)
for adv_x in tf.unstack(adv):
img = tf.cast(adv_x, dtype=tf.uint8)
tf_image = tf.image.encode_jpeg(img)
tf.write_file('adversarial_examples/' + str(i) + '.jpg', tf_image)
i += 1
Where FastGradientMethod is from cleverhans
. This runs without an error, but the jpg's don't exist in my folder. What's missing?