eth-sri / eran

ETH Robustness Analyzer for Deep Neural Networks
Apache License 2.0
313 stars 100 forks source link

ModuleNotFoundError: No module named 'zonoml' #85

Closed jkomyno closed 3 years ago

jkomyno commented 3 years ago

Hi, thank you for this project. I followed all the installation steps mentioned in the README, and I have installed eran on Ubuntu 20.04.

When running tf-verify with the deeppoly domain, I have the following error:

~/ERAN/tf_verify$ python3 . --netname ../nets/ffnnRELU__Point_6_500.onnx --epsilon 0.2 --domain deeppoly --dataset mnist --complete True
2021-06-21 19:18:41.868233: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: :/usr/local/lib:/home/jkomyno/gurobi900/linux64/lib
2021-06-21 19:18:41.868306: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "./__main__.py", line 25, in <module>
    from eran import ERAN
  File "./eran.py", line 20, in <module>
    from optimizer import *
  File "./optimizer.py", line 18, in <module>
    from deepzono_nodes import *
  File "./deepzono_nodes.py", line 19, in <module>
    from zonoml import *
ModuleNotFoundError: No module named 'zonoml'

I haven't found any reference to this in other open issues. I also tried pip3 install zonoml. How can I fix this?

mnmueller commented 3 years ago

Hello @jkomyno,

thank you for your interest in ERAN. zonoml is part of ELINA and should have been installed when following the README. Can you check that the following (relative) path exists eran/ELINA/python_interface/zonoml.py?

To include the python_interface directory in the python search path, we add the relative path before other import statements here: https://github.com/eth-sri/eran/blob/396dc7a118d0b8772b4f0e9684f9203c9c9b6f63/tf_verify/__main__.py#L21 For this to work it is important that your working directory is tf_verify. Otherwise, you can replace the fragment above with:

sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)),"../ELINA/python_interface/"))

However, I would try to avoid this, since other issues might arise due to an unexpected working directory.

Cheers, Mark

jkomyno commented 3 years ago

Grüezi @mnmueller, thank you for the quick reply :) I noticed that I had downloaded ELINA and the other dependencies in ~ rather than in ~/eran. I moved them to ~/eran as you suggested and it worked! I'm thus closing this issue.

Best regards, Alberto