Skip to content
New issue

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

Import error in pts module: gluonts/nursery/robust-mts-attack/pts/modules/distribution_output.py #3193

Open
ClaraGrthns opened this issue Jun 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ClaraGrthns
Copy link
Contributor

Description

There is an Import error in the pts module in gluonts/nursery/robust-mts-attack/pts/modules/distribution_output.py

To Reproduce

The following lines of code yield the Import Error:

from gluonts.torch.modules.distribution_output import (
    DistributionOutput,
    LambdaLayer,
    PtArgProj,
)

Error message or code output

Traceback (most recent call last):
  File "gluonts/src/gluonts/nursery/robust-mts-attack/pts/modules/distribution_output.py", line 47, in <module>
    from gluonts.torch.modules.distribution_output import (
ModuleNotFoundError: No module named 'gluonts.torch.modules.distribution_output'

Proposed Solution:

The following lines of code should solve the problem to match the current version of gluonts (v 0.15.0).

from gluonts.torch.distributions.distribution_output import DistributionOutput
from gluonts.torch.modules.lambda_layer import LambdaLayer
from gluonts.torch.distributions.output import PtArgProj

Environment

  • Operating system: MacOS 14.0
  • Python version: 3.11.
  • GluonTS version: 0.15.0
@ClaraGrthns ClaraGrthns added the bug Something isn't working label Jun 14, 2024
lostella added a commit that referenced this issue Jun 14, 2024
*Issue #, if available:* #3193

*Description of changes:* Import Error solved with updated imports
matching the new version of gluonts


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.


Tag: bug fix (import error)

Co-authored-by: Clara Grotehans <ClaraGrthns>
Co-authored-by: Lorenzo Stella <[email protected]>
kashif pushed a commit to kashif/gluon-ts that referenced this issue Jun 15, 2024
*Issue #, if available:* awslabs#3193

*Description of changes:* Import Error solved with updated imports
matching the new version of gluonts


By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.


Tag: bug fix (import error)

Co-authored-by: Clara Grotehans <ClaraGrthns>
Co-authored-by: Lorenzo Stella <[email protected]>
@ucmcidt
Copy link

ucmcidt commented Feb 20, 2025

There is a similar Import error in the pts model "deepvar" in n gluonts/nursery/robust-mts-attack/pts/model/deepvar/ in the two files
deepvar_estimator.py and deepvar_network.py

e.g.:
robust-mts-attack\pts\model\deepvar\deepvar_network.py", line 22, in
from gluonts.torch.modules.distribution_output import DistributionOutput
ModuleNotFoundError: No module named 'gluonts.torch.modules.distribution_output'

It is solved by modifying the line:
from gluonts.torch.modules.distribution_output import DistributionOutput
by:
from gluonts.torch.distributions.distribution_output import DistributionOutput

to work on GluonTS v0.16.0

Operating system: Windows 11
Python version: 3.11.11
GluonTS version: 0.16.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants