MadryLab / robustness

A library for experimenting with, training and evaluating neural networks, with a focus on adversarial robustness.
MIT License
903 stars 181 forks source link

ModuleNotFoundError: No module named 'robustness.model_utils'; 'robustness' is not a package #117

Closed jS5t3r closed 1 year ago

jS5t3r commented 2 years ago

Error

> python -m robustness.main 

from robustness.model_utils import make_and_restore_model
ModuleNotFoundError: No module named 'robustness.model_utils'; 'robustness' is not a package

Installed packages: robustness 1.2.1.post2 torch 1.12.0 torchvision 0.13.0 numpy 1.21.6 pandas 1.3.5

I am not able to use the robustness lib. I have installed it via pip.

rrmhearts commented 1 year ago

Have you found a solution to this? I'm using a virtual environment.

ModuleNotFoundError: No module named 'robustness.datasets'; 'robustness' is not a package

rrmhearts commented 1 year ago

Fixed it, you might have a file in your workspace called "robustness.py"

jS5t3r commented 1 year ago

@rrmhearts where did you find the robustness.py?

rrmhearts commented 1 year ago

I'm saying a file called robustness.py in my workspace was hiding the package. None of your files can be named robustness in the local workspace for Python to find the installed module.