Giter VIP home page Giter VIP logo

Comments (9)

ririnicolae avatar ririnicolae commented on May 26, 2024

Fixed in b0ecc55.

from adversarial-robustness-toolbox.

aldahdooh avatar aldahdooh commented on May 26, 2024

Bug still there (ART version 1.3.1)

Traceback (most recent call last):
  File "generate_adv.py", line 194, in <module>
    main(args)
  File "generate_adv.py", line 175, in main
    adv_data = attack.generate(x=x_test, y=y_test)
  File "/home/aaldahdo/adv_dnn/venv/lib/python3.8/site-packages/art/attacks/attack.py", line 74, in replacement_function
    return fdict[func_name](self, *args, **kwargs)
  File "/home/aaldahdo/adv_dnn/venv/lib/python3.8/site-packages/art/attacks/evasion/zoo.py", line 222, in generate
    res = self._generate_batch(x_batch, y_batch)
  File "/home/aaldahdo/adv_dnn/venv/lib/python3.8/site-packages/art/attacks/evasion/zoo.py", line 263, in _generate_batch
    best_dist, best_label, best_attack = self._generate_bss(x_batch, y_batch, c_current)
  File "/home/aaldahdo/adv_dnn/venv/lib/python3.8/site-packages/art/attacks/evasion/zoo.py", line 380, in _generate_bss
    x_adv = self._optimizer(x_adv, y_batch, c_batch)
  File "/home/aaldahdo/adv_dnn/venv/lib/python3.8/site-packages/art/attacks/evasion/zoo.py", line 455, in _optimizer
    expanded_x, expanded_x + coord_batch.reshape(expanded_x.shape), expanded_targets, expanded_c,
ValueError: cannot reshape array of size 25165824 into shape (4096,32,32,3)

from adversarial-robustness-toolbox.

beat-buesser avatar beat-buesser commented on May 26, 2024

Hi @aldahdooh, thank you for your message. I was not able to reproduce your observation with branch dev_1.4.3 based on example get_started_pytorch.pychange to useZooAttack`. Could you please provide more details or code example how to reproduce the error?

from adversarial-robustness-toolbox.

aldahdooh avatar aldahdooh commented on May 26, 2024

For CIFAR-10 dataset with keras model
Note: No error with MNIST

attack = ZooAttack(classifier=kclassifier, batch_size=32)
adv_data = attack.generate(x=x_test, y=y_test)

from adversarial-robustness-toolbox.

beat-buesser avatar beat-buesser commented on May 26, 2024

Hi @aldahdooh I have tried to reproduce this issue with dev_1.3.1 and dev_1.4.3 using get_started_keras.py and have not been able to reproduce the issue with the attack definition above for the first 32 test samples. Would you be able to show the entire code example producing this issue?

from adversarial-robustness-toolbox.

aldahdooh avatar aldahdooh commented on May 26, 2024

zoo_test.zip

Thanks for your reply, Attached is the code. Just run generate_adv.py -d=cifar. I run it with MNIST and no errors encountered. With CIFAR, the problem came with the last batch iteration.

from adversarial-robustness-toolbox.

beat-buesser avatar beat-buesser commented on May 26, 2024

Oh, I see, it happens in the last batch iteration, thank you, that's very helpful. Let me try again using your code.

from adversarial-robustness-toolbox.

beat-buesser avatar beat-buesser commented on May 26, 2024

Hi @aldahdooh I have pushed an update for ZOO to #755 that should fix the issue. If you have time, could you please try it out and let me know if it works for you?

I have noticed that you are creating the attacks in generate_adv.py with the attack's default arguments which are selected to let the attack run fast but not necessarily very strong.

from adversarial-robustness-toolbox.

aldahdooh avatar aldahdooh commented on May 26, 2024

Hi @beat-buesser, Many thanks for your feedback. I will do that ASAP since my machine is busy now with other tasks.
And thanks for your note, I do agree with you, I did that to compare with other works that use same settings.

from adversarial-robustness-toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.