Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tf2.1 DeepFool attack errors with eagerpy implementation #552

Open
marissadotter opened this issue Jun 9, 2020 · 1 comment
Open

tf2.1 DeepFool attack errors with eagerpy implementation #552

marissadotter opened this issue Jun 9, 2020 · 1 comment

Comments

@marissadotter
Copy link

HI! When implementing DeepFool L2 attack, I get an error caused by a function not being implemented in eagerpy. Is there any update on when this function will be updated, or any work-arounds to get this attack running?

I am running tensorflow 2.1, and the latest follbox 3.0.2, eagerpy 0.27.0

Here is the error output:

Traceback (most recent call last):
  File "foolbox_deepfool.py", line 67, in <module>
    adv = gen_atack(fmodel, j, attack, i, k)
  File "foolbox_deepfool.py", line 46, in gen_atack
    adversarial = attack(fmodel, ep.astensor(img), criterion, epsilons=epsilon) 
  File "/home/mdotter/.conda/envs/tf2/lib/python3.7/site-packages/foolbox/attacks/base.py", line 410, in __call__
    xp = self.run(model, x, criterion, early_stop=early_stop, **kwargs)
  File "/home/mdotter/.conda/envs/tf2/lib/python3.7/site-packages/foolbox/attacks/deepfool.py", line 129, in run
    loss_aux_and_grad = ep.value_and_grad_fn(x, loss_fun, has_aux=True)
  File "/home/mdotter/.conda/envs/tf2/lib/python3.7/site-packages/eagerpy/framework.py", line 340, in value_and_grad_fn
    return t._value_and_grad_fn(f, has_aux=has_aux)
  File "/home/mdotter/.conda/envs/tf2/lib/python3.7/site-packages/eagerpy/tensor/numpy.py", line 363, in _value_and_grad_fn
    raise NotImplementedError  # pragma: no cover
NotImplementedError
@jonasrauber
Copy link
Member

Can you share some of the code you are running?
I guess you are passing in NumPy arrays where Foolbox expects TensorFlow tensors (for this model), but it's hard to tell without any code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants