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

[BUG] AttributeError: 'DefaultForecasterConfig' object has no attribute 'invert_transform' #103

Closed
bkowshik opened this issue Jun 7, 2022 · 3 comments

Comments

@bkowshik
Copy link

bkowshik commented Jun 7, 2022

Describe the bug

fig, ax = model.plot_forecast(time_series=dataset_test, plot_forecast_uncertainty=True)

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-49-a413bfb44d12> in <module>
----> 1 fig, ax = model.plot_forecast(time_series=dataset_test, plot_forecast_uncertainty=True)

/usr/local/lib/python3.7/site-packages/merlion/models/forecast/base.py in plot_forecast(self, time_series, time_stamps, time_series_prev, plot_forecast_uncertainty, plot_time_series_prev, figsize, ax)
    498             time_series_prev=time_series_prev,
    499             plot_forecast_uncertainty=plot_forecast_uncertainty,
--> 500             plot_time_series_prev=plot_time_series_prev,
    501         )
    502         title = f"{type(self).__name__}: Forecast of {self.target_name}"

/usr/local/lib/python3.7/site-packages/merlion/models/forecast/base.py in get_figure(self, time_series, time_stamps, time_series_prev, plot_forecast_uncertainty, plot_time_series_prev)
    400         ), "Must provide at least one of time_series or time_stamps"
    401         if time_stamps is None:
--> 402             if self.invert_transform:
    403                 time_stamps = time_series.time_stamps
    404                 y = time_series.univariates[time_series.names[self.target_seq_index]]

/usr/local/lib/python3.7/site-packages/merlion/models/layers.py in __getattr__(self, item)
    271         if callable(attr):
    272             return attr
--> 273         return self.__getattribute__(item)
    274 
    275     def train(self, train_data: TimeSeries, *args, **kwargs):

/usr/local/lib/python3.7/site-packages/merlion/models/forecast/base.py in invert_transform(self)
     88         :return: Whether to automatically invert the ``transform`` before returning a forecast.
     89         """
---> 90         return self.config.invert_transform
     91 
     92     @property

/usr/local/lib/python3.7/site-packages/merlion/models/layers.py in __getattr__(self, item)
    113         elif base_model is None and item in self.model_kwargs:
    114             return self.model_kwargs.get(item)
--> 115         return self.__getattribute__(item)
    116 
    117     def __setattr__(self, key, value):

AttributeError: 'DefaultForecasterConfig' object has no attribute 'invert_transform'

To Reproduce
Notebook using a different dataset https://github.com/salesforce/Merlion/blob/main/examples/forecast/0_ForecastIntro.ipynb

Expected behavior
Visualization of the actual and forecasted values.

Desktop (please complete the following information):

  • OS: macOS Big Sur
  • Merlion version: 1.2.0
@SinclairGurny
Copy link

Having this error as well

@aadyotb
Copy link
Contributor

aadyotb commented Jun 7, 2022

This is related to #101. Thanks for highlighting the issue.

@aadyotb
Copy link
Contributor

aadyotb commented Jun 9, 2022

Fixed in #104.

@aadyotb aadyotb closed this as completed Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants