gkdziugaite / pacbayes-opt

Optimizing PAC-Bayes bounds for Stochastic Neural Networks with Gaussian weights
Apache License 2.0
26 stars 7 forks source link

Repository path in run_sgd.py #2

Closed natema closed 4 years ago

natema commented 4 years ago

After setting up a conda environment on my Linux machine as described in the README, and issuing the command python3.5 snn/experiments/run_sgd.py fc --layers 600 --sgd_epochs 20 --binary I was getting the error

Traceback (most recent call last):
  File "snn/experiments/run_sgd.py", line 6, in <module>
    from snn.core import package_path
ImportError: No module named 'snn'

In fixed it by changing the lines 3 and 4 in snn/experiments/run_sgd.py, to

sys.path.insert(0, "PATH/snn/")
sys.path.insert(0, "PATH")

where PATH is the absolute path to the repository folder.

Perhaps this is something which should be mentioned in the README.

natema commented 4 years ago

In fact

sys.path.insert(0, "./snn/")
sys.path.insert(0, "./")

also fixes the issue.

wgharbieh commented 4 years ago

Hi @natema, adding the snn folder to the PYTHONPATH is another way to fix the issue.