time-series-foundation-models / lag-llama

Lag-Llama: Towards Foundation Models for Probabilistic Time Series Forecasting
Apache License 2.0
1.08k stars 121 forks source link

KeyError: 'past_target' #69

Closed whxhandsomeman closed 1 week ago

whxhandsomeman commented 4 weeks ago

In GluonTS version 0.14.4, without making additional modifications to Demo1, the function get_lag_llama_predictions forecasts, tss = get_lag_llama_predictions(backtest_dataset, prediction_length, device, num_samples) throws an error: /content/lag-llama/lag_llama/gluon/lightning_module.py in forward(self, *args, *kwargs) 216 # greedy prediction 217 def forward(self, args, **kwargs): --> 218 past_target = kwargs[ 219 "past_target" 220 ] # (bsz, model.context_length+max(model.lags_seq)) KeyError: 'past_target'

YYZ-GO commented 3 weeks ago

Please use: !pip install gluonts==0.14.4 And avoid using: !pip install gluonts[torch]==0.14.4

ashok-arjun commented 3 weeks ago

Hi @whxhandsomeman, are you using the requirements specified in the requirements file? We have not tested our code with other versions of packages.

Can you share a reproducible Colab notebook with the error please?

ashok-arjun commented 1 week ago

This should be solved with the requirements update. Closing this. Please reopen if necessary!