unit8co / darts

A python library for user-friendly forecasting and anomaly detection on time series.
https://unit8co.github.io/darts/
Apache License 2.0
8.05k stars 878 forks source link

[BUG] RuntimeError: No precision set #1718

Closed rishi-a closed 1 year ago

rishi-a commented 1 year ago

Describe the bug Fitting the NBeats model results in RuntimeError: No precision set

To Reproduce

  1. Follow the official documentation of darts here: Quickstart Guide
    
    from darts.models import NBEATSModel

model = NBEATSModel(input_chunk_length=24, output_chunk_length=12, random_state=42)

model.fit([train_air_scaled, train_milk_scaled], epochs=50, verbose=True);


2.  Follow the tutorial as given with the same dataset, i.e. the _AirPassengersDataset, MonthlyMilkDataset_

**Expected behavior**
I expected results as shown in the Quickstart guide. 

**System:**
 - Python version: 3.9.12
 - darts version: 0.24.0
rishi-a commented 1 year ago

Resolved it temporarily by upgrading Pytorch Lightning to the latest version. Not sure if that was the actual solution to the problem as well.

helenehanyu commented 1 year ago

I ran into the same issue. Updated Pytorch-lightning. However, I can not use optuna with the latest version of PyTorch-lightning.

dennisbader commented 1 year ago

Yes, the PyTorch-Lightning (PTL) version was most likely the root cause for this issue. I believe PTL versions shortly before 2.0.0 should work fine as well.

@helenehanyu it should work if you replace Optuna'sPyTorchLightningPruningCallback with the one proposed in our example description here (the link is not formatted well in docs unfortunately, I'll fix that soon. Here is the link).

helenehanyu commented 1 year ago

Thank you @dennisbader , now it works.