Nixtla / neuralforecast

Scalable and user friendly neural :brain: forecasting algorithms.
https://nixtlaverse.nixtla.io/neuralforecast
Apache License 2.0
2.93k stars 336 forks source link

[BUG] NHITS and NBEATS models fail (NameError: name 'get_comm_manager' is not defined) #420

Closed AzulGarza closed 1 month ago

AzulGarza commented 1 year ago

Describe the bug I'm getting the following error using NeuralForecast.cross_validation,

image

To Reproduce

from neuralforecast import NeuralForecast
from neuralforecast.models import NHITS, NBEATS
from neuralforecast.losses.pytorch import MQLoss 

Y_df = pd.read_parquet('s3://m5-benchmarks/data/train/target.parquet')
Y_df = Y_df.rename(columns={
    'item_id': 'unique_id', 
    'timestamp': 'ds', 
    'demand': 'y'
})
Y_df['ds'] = pd.to_datetime(Y_df['ds'])

Y_df = Y_df.query('unique_id.str.startswith("FOODS_3")')
Y_df['unique_id'] = Y_df['unique_id'].astype(str)

nf = NeuralForecast(
    models=[
        NHITS(h=horizon, input_size=2 * horizon, loss=MQLoss(level=[90]), max_epochs=500), 
        NBEATS(h=horizon, input_size=2 * horizon, loss=MQLoss(level=[90]), max_epochs=500)
    ],
    freq='D'
)

nf.cross_validation(Y_df, n_windows=3, step_size=horizon)
marcopeix commented 1 month ago

Issue cannot be reproduced and seems to be fixed!