awslabs / gluonts

Probabilistic time series modeling in Python
https://ts.gluon.ai
Apache License 2.0
4.57k stars 749 forks source link

Notebook problem #3124

Open moghadas76 opened 7 months ago

moghadas76 commented 7 months ago

Description

for the notebook https://ts.gluon.ai/stable/tutorials/advanced_topics/howto_pytorch_lightning.html, cell 27 produced error


AttributeError Traceback (most recent call last) Cell In[31], line 8 6 ax = plt.subplot(3, 3, idx + 1) 7 plt.plot(ts[-5 * prediction_length :].to_timestamp(), label="target") ----> 8 forecast.plot() 9 plt.xticks(rotation=60) 10 ax.xaxis.set_major_formatter(date_formater)

File ~/miniconda3/envs/env/lib/python3.11/site-packages/gluonts/model/forecast.py:315, in Forecast.plot(self, intervals, ax, color, name, show_label) 311 ax = maybe.unwrap_or_else(ax, plt.gca) 313 # If no color is provided, we use matplotlib's internal color cycle. 314 # Note: This is an internal API and might change in the future. --> 315 color = maybe.unwrap_or_else( 316 color, lambda: next(ax._get_lines.prop_cycler)["color"] 317 ) 319 # Plot median forecast 320 ax.plot( 321 self.index.to_timestamp(), 322 self.quantile(0.5), 323 color=color, 324 label=name, 325 )

File ~/miniconda3/envs/env/lib/python3.11/site-packages/gluonts/maybe.py:179, in unwrap_or_else(val, factory) ... 323 color=color, 324 label=name, 325 )

AttributeError: '_process_plot_var_args' object has no attribute 'prop_cycler'

lostella commented 7 months ago

@moghadas76 the issue template for bug reporting asks for details such as gluonts version; not providing those may complicate understanding the issue.

Can you provide versions for gluonts, matplotlib, python, and what OS you’re running?