Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

continue_training parameter in fit() does not exist in the main branch but is documented in the official site #1674

Open
anandaheino opened this issue Jan 17, 2025 · 0 comments

Comments

@anandaheino
Copy link

While me and @heinoso were trying to use the continue_training parameter in the forecaster.py/fit() method as described in the official documentation we encountered an issue.
Image

Image

According to the documentation, this parameter is meant to allow continued training from the last checkpoint. However, when I try to fit the model again using this parameter, I receive the following error:

RuntimeError: Model has been fitted already. Please initialize a new model to fit again.

Inspecting the source code in the main branch, the fit() method does not include the continue_training parameter. The only parameters available are:

def fit(
self,
df: pd.DataFrame,
freq: str = "auto",
validation_df: Optional[pd.DataFrame] = None,
epochs: Optional[int] = None,
batch_size: Optional[int] = None,
learning_rate: Optional[float] = None,
early_stopping: bool = False,
minimal: bool = False,
metrics: Optional[np_types.CollectMetricsMode] = None,
metrics_log_dir: Optional[str] = None,
progress: Optional[str] = "bar",
checkpointing: bool = False,
num_workers: int = 0,
deterministic: bool = False,
scheduler: Optional[Union[str, Type[torch.optim.lr_scheduler.LRScheduler]]] = None,
scheduler_args: Optional[dict] = None,
trainer_config: Optional[dict] = None,
):

After further investigation, I found that the continue_training parameter is present only in the train-continue branch, which depends on the custom-lr-scheduler branch.

Suggestions

  • Include the continue_training parameter in the fit() method in the main branch.
  • Ensure the documentation aligns with the main branch to avoid confusion for users.
  • If this feature is still under development, clarify in the documentation that it is available only in specific branches/versions.

Final Comentary

We really enjoy using NeuralProphet model, it gives really great results and I would love to be able to refit the model, just like in other models (e.g. Prophet, XGBoost, LightGBM, etc). Keep up with the great work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant