How to resolve ModuleNotFoundError: No module named 'gluonts.torch.modules.distribution_output'?

633 Views Asked by At

I am working on a project and I am trying to run the code from this repository: https://github.com/jc-audet/WOODS

I was able to get past this step:

python3 -m woods.scripts.download_datasets {dataset} \
        --data_path /path/to/data/directory

Then when I tried to run this step:

python3 -m woods.scripts.main train \
        --dataset Spurious_Fourier \
        --objective ERM \
        --test_env 0 \
        --data_path /path/to/data/directory

I get the following error:

File "/Users/evangertis/development/UGA/Research/WOODS/woods/datasets.py", line 1839, in <module>
    from gluonts.torch.modules.distribution_output import (
ModuleNotFoundError: No module named 'gluonts.torch.modules.distribution_output

I was expecting the code to Train a model using one objective on one dataset with one test environment. I get the following error:

 warnings.warn(
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/evangertis/development/UGA/Research/WOODS/woods/scripts/hparams_sweep.py", line 14, in <module>
    from woods import utils
  File "/Users/evangertis/development/UGA/Research/WOODS/woods/utils.py", line 13, in <module>
    from woods.scripts import hparams_sweep
  File "/Users/evangertis/development/UGA/Research/WOODS/woods/scripts/hparams_sweep.py", line 17, in <module>
    from woods import datasets
  File "/Users/evangertis/development/UGA/Research/WOODS/woods/datasets.py", line 1839, in <module>
    from gluonts.torch.modules.distribution_output import (
ModuleNotFoundError: No module named 'gluonts.torch.modules.distribution_output'
1

There are 1 best solutions below

0
On

You can simply update it

pip install --upgrade gluonts