Nixtla / neuralforecast

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

[BUG] KeyError: 'autormok' on loading #1166

Closed elephaint closed 1 month ago

elephaint commented 1 month ago

Discussed in https://github.com/Nixtla/neuralforecast/discussions/1165

Originally posted by **aiv1** September 30, 2024 I've saved and loaded trained model as in tutorial. Got following error: --------------------------------------------------------------------------- KeyError Traceback (most recent call last) Cell In[51], [line 1](vscode-notebook-cell:?execution_count=51&line=1) ----> [1](vscode-notebook-cell:?execution_count=51&line=1) nf2 = NeuralForecast.load(path='./checkpoints/test_run/') [2](vscode-notebook-cell:?execution_count=51&line=2) Y_hat_df = nf2.predict().reset_index() [3](vscode-notebook-cell:?execution_count=51&line=3) Y_hat_df.head() File c:\Users\mk\micromamba\envs\neuralforecast\Lib\site-packages\neuralforecast\core.py:1507, in NeuralForecast.load(path, verbose, **kwargs) [1505](file:///C:/Users/mk/micromamba/envs/neuralforecast/Lib/site-packages/neuralforecast/core.py:1505) model_name = "_".join(model.split("_")[:-1]) [1506](file:///C:/Users/mk/micromamba/envs/neuralforecast/Lib/site-packages/neuralforecast/core.py:1506) model_class_name = alias_to_model.get(model_name, model_name) -> [1507](file:///C:/Users/mk/micromamba/envs/neuralforecast/Lib/site-packages/neuralforecast/core.py:1507) loaded_model = MODEL_FILENAME_DICT[model_class_name].load( [1508](file:///C:/Users/mk/micromamba/envs/neuralforecast/Lib/site-packages/neuralforecast/core.py:1508) f"{path}/{model}", **kwargs [1509](file:///C:/Users/mk/micromamba/envs/neuralforecast/Lib/site-packages/neuralforecast/core.py:1509) ) [1510](file:///C:/Users/mk/micromamba/envs/neuralforecast/Lib/site-packages/neuralforecast/core.py:1510) loaded_model.alias = model_name [1511](file:///C:/Users/mk/micromamba/envs/neuralforecast/Lib/site-packages/neuralforecast/core.py:1511) models.append(loaded_model) KeyError: 'autormok'