Trusted-AI/adversarial-robustness-toolbox

Invalid torch version check in `adversarial_patch_pytorch`

jprokos26 opened this issue · 1 comments

Describe the bug
This assert:

assert torch_version[0] >= 1 and torch_version[1] >= 7, "AdversarialPatchPyTorch requires torch>=1.7.0"

Does not pass for torch >= 2.0.0 since the version check is incorrect.

To Reproduce
Steps to reproduce the behavior:

  1. Run adversarial_patch_pytorch with torch >= 2.0.0

Expected behavior
It works

Screenshots

  File "/home/jonathan.prokos/.venv/dev/lib/python3.10/site-packages/art/attacks/evasion/adversarial_patch/adversarial_patch_pytorch.py", line 126, in __init__
    assert torch_version[0] >= 1 and torch_version[1] >= 7, "AdversarialPatchPyTorch requires torch>=1.7.0"
           │                         └ [2, 0, 0]
           └ [2, 0, 0]

System information (please complete the following information):

  • OS: linux
  • Python version: 3.8
  • ART version or commit number: 1.14.1
  • TensorFlow / Keras / PyTorch / MXNet version: pytorch 2.0.0

Duplicate of #2095