time-series-foundation-models / lag-llama

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

How to finetune this model #6

Closed zhilif closed 3 months ago

zhilif commented 4 months ago

Thanks for releasing this foundation model! I wonder if you have code that demonstrates how to finetune Lag-Llama with custom training data? Thanks!

kashif commented 4 months ago

coming up after a short recoup! stay tuned. Essentially since its a gluonts Estimator, one should be able to estimator.train() on your data but we need to remove some bespoke fields that were left behind in the lightning callbacks...

ashok-arjun commented 4 months ago

Yes, as @kashif says, the fine-tuning scripts are coming soon. Scripts to load datasets in custom formats are also coming soon. Thank you for your patience.

kashif commented 3 months ago

@zhilif have a look at the colab https://colab.research.google.com/drive/1uvTmh-pe1zO5TeaaRVDdoEWJ5dFDI-pA?usp=sharing

shahrokhvahabi commented 3 months ago

@kashif thank you for providing the code. Unfortunately, I got this error during fine-tuning:

TypeError: model must be a LightningModule or torch._dynamo.OptimizedModule, got LagLlamaLightningModule

kashif commented 3 months ago

@shahrokhvahabi try to git pull, I believe its somehow running an older code

shahrokhvahabi commented 3 months ago

@kashif I deleted the lag-llama and cloned again it from the repository. But this error occurred again.

kashif commented 3 months ago

@shahrokhvahabi its due to the newer lightning version you have... so try do to:

!pip uninstall -A gluonts
!pip install -U gluonts[torch]
shahrokhvahabi commented 3 months ago

@kashif I did but the error is persistent.

kashif commented 3 months ago

ah sorry i meant to say:

!pip uninstall -A lightning pytorch-lightning gluonts
!pip install -U gluonts[torch]
shahrokhvahabi commented 3 months ago

ah sorry i meant to say:

!pip uninstall -A lightning pytorch-lightning gluonts
!pip install -U gluonts[torch]

Thank you for the reply @kashif . I did as you mentioned above. Could you please give me another suggestion to avoid this error?

kashif commented 3 months ago

yeah not sure what more i can do... somehow your setup is sucking in a newer version of lightning

perhaps

!pip install lightning==2.1.4 pytorch-lightning==2.1.4
shahrokhvahabi commented 3 months ago

@kashif Could you please send those files in the model you updated so that I can replace them manually?

kashif commented 3 months ago

make a new issue instead of hijacking this one as the original author is getting spammed unnecessarily closing this