bethgelab / bethgelab/foolbox

tf2.1 DeepFool attack errors with eagerpy implementation

Open
#552 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
3k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

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
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
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with foolbox/attacks/deepfool.py at the value_and_grad_fn call and inspect eagerpy/tensor/numpy.py, where the traceback raises NotImplementedError. Reproduce with TensorFlow 2.1, Foolbox 3.0.2, and eagerpy 0.27.0, then determine whether the attack can run through a supported backend or whether the limitation needs a documented workaround. Done means the failure is resolved or a verified workaround is recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.