We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The library seems not to be compatible with numpy >= 2.0 due to import issues.
When importing the attacks, for example, FoolboxPGDL2:
from secml.adv.attacks import CFoolboxPGDL2
an ImportError is obtained.
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[1], [line 1](vscode-notebook-cell:?execution_count=1&line=1) ----> [1](vscode-notebook-cell:?execution_count=1&line=1) from secml.adv.attacks import CFoolboxPGDL2 File [~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/__init__.py:4](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/__init__.py:4) [1](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/__init__.py:1) from .c_attack import CAttack [2](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/__init__.py:2) from .c_attack_mixin import CAttackMixin ----> [4](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/__init__.py:4) from .evasion import * [5](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/__init__.py:5) from .poisoning import * File [~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:22](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:22) [20](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:20) else: [21](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:21) from .foolbox.secml_autograd import SecmlLayer ---> [22](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:22) from .foolbox.c_attack_evasion_foolbox import \ [23](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:23) CAttackEvasionFoolbox [24](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:24) from .foolbox.fb_attacks.fb_basic_iterative_attack import \ [25](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:25) CFoolboxBasicIterative, CFoolboxBasicIterativeL1, \ [26](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:26) CFoolboxBasicIterativeL2, CFoolboxBasicIterativeLinf [27](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:27) from .foolbox.fb_attacks.fb_cw_attack import \ [28](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/__init__.py:28) CFoolboxL2CarliniWagner File [~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/foolbox/c_attack_evasion_foolbox.py:14](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/foolbox/c_attack_evasion_foolbox.py:14) [12](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/foolbox/c_attack_evasion_foolbox.py:12) import torch [13](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/foolbox/c_attack_evasion_foolbox.py:13) from eagerpy import PyTorchTensor ... [16](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/foolbox/c_attack_evasion_foolbox.py:16) from secml.adv.attacks.evasion import CAttackEvasion [17](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/foolbox/c_attack_evasion_foolbox.py:17) from secml.adv.attacks.evasion.foolbox.secml_autograd import \ [18](https://file+.vscode-resource.vscode-cdn.net/home/lazzaro/Desktop/Dottorato/Lezioni/ADML24/ADML24%20Exam/~/miniconda3/envs/secml2/lib/python3.9/site-packages/secml/adv/attacks/evasion/foolbox/c_attack_evasion_foolbox.py:18) SecmlLayer, as_tensor, as_carray ImportError: cannot import name 'NaN' from 'numpy' (/home/lazzaro/miniconda3/envs/secml2/lib/python3.9/site-packages/numpy/__init__.py)
A possible fix is to install numpy==1.26.4
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The library seems not to be compatible with numpy >= 2.0 due to import issues.
Steps to reproduce
When importing the attacks, for example, FoolboxPGDL2:
an ImportError is obtained.
Relevant logs
Possible fixes
A possible fix is to install numpy==1.26.4
The text was updated successfully, but these errors were encountered: