Trusted-AI/adversarial-robustness-toolbox

Assert Trigger with Torch 2.0 (AssertionError: AdversarialPatchPyTorch requires torch>=1.7.0)

hediD opened this issue · 2 comments

hediD commented

Bug
This assertion has to change as it triggers with torch 2.0 or higher.
It's due to Line 126 from art/attacks/evasion/adversarial_patch/adversarial_patch_pytorch.py
assert torch_version[0] >= 1 and torch_version[1] >= 7

Correction
assert (torch_version[0] >= 1 and torch_version[1] >= 7) or (torch_version[0]>=2)

Hi @hediD Thank you very much! Would you be interested in opening a pull request for your solution?

Linking with #2095 for PyTorch 2.0

hediD commented

No need it to create a PR it seems. commit 5f039c0 has applied the Correction :)