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

RuntimeError: Error during optimization! #2573

Open
Tuyen92 opened this issue Apr 24, 2024 · 2 comments
Open

RuntimeError: Error during optimization! #2573

Tuyen92 opened this issue Apr 24, 2024 · 2 comments

Comments

@Tuyen92
Copy link

Tuyen92 commented Apr 24, 2024

I'm encountering an issue with the usage of prophet.fit(), and I'm uncertain about how to resolve it. I'm using Python version 3.10.8, with Prophet version 1.1.5. Additionally, I have created a DataFrame named 'train' with two columns, 'ds' and 'y', to pass into the fit() function.

This is error return to me

Traceback (most recent call last):
  File "d:\dev.team.schedule.report\venv310devteam\lib\site-packages\prophet\models.py", line 121, in fit
    self.stan_fit = self.model.optimize(**args)
  File "d:\dev.team.schedule.report\venv310devteam\lib\site-packages\cmdstanpy\model.py", line 659, in optimize
    raise RuntimeError(msg)
RuntimeError: Error during optimization! Command 'D:\dev.team.schedule.report\venv310devteam\Lib\site-packages\prophet\stan_model\prophet_model.bin random seed=90356 data file=C:\Users\TUYEN~1.NGU\AppData\Local\Temp\tmpd5_o053z\ie1zkgh3.json init=C:\Users\TUYEN~1.NGU\AppData\Local\Temp\tmpd5_o053z\ass3difi.json output file=C:\Users\TUYEN~1.NGU\AppData\Local\Temp\tmpd5_o053z\prophet_modelw6ec5z94\prophet_model-20240424120047.csv method=optimize algorithm=lbfgs iter=10000' failed:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\dev.team.schedule.report\odooreport\fastapi_app\fast_api.py", line 359, in insert_forecast_one_project
    return insert_forecast_one_project_impl(target_db, is_considered_holidays)
  File "D:\dev.team.schedule.report\odooreport\fastapi_app\fast_api.py", line 236, in insert_forecast_one_project_impl
    forecasts = create_forecast_one_project_considering_seasonality(target_db=target_db)
  File "D:\dev.team.schedule.report\odooreport\odooreportapp\refactored_forecast.py", line 262, in create_forecast_one_project_considering_seasonality
    forecast_add_project_id = calculate_forecast_one_project_considering_seasonality(target_db)
  File "D:\dev.team.schedule.report\odooreport\odooreportapp\refactored_forecast.py", line 252, in calculate_forecast_one_project_considering_seasonality
    forecast = apply_considering_holiday_prophet_one_project(renamed_detail_cumulative_invoice_df, df_project_target, project, detail_invoice_df)
  File "D:\dev.team.schedule.report\odooreport\odooreportapp\refactored_forecast.py", line 134, in apply_considering_holiday_prophet_one_project
    prophet.fit(train)
  File "d:\dev.team.schedule.report\venv310devteam\lib\site-packages\prophet\forecaster.py", line 1232, in fit
    self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
  File "d:\dev.team.schedule.report\venv310devteam\lib\site-packages\prophet\models.py", line 129, in fit
    self.stan_fit = self.model.optimize(**args)
  File "d:\dev.team.schedule.report\venv310devteam\lib\site-packages\cmdstanpy\model.py", line 659, in optimize
    raise RuntimeError(msg)
RuntimeError: Error during optimization! Command 'D:\dev.team.schedule.report\venv310devteam\Lib\site-packages\prophet\stan_model\prophet_model.bin random seed=59458 data file=C:\Users\TUYEN~1.NGU\AppData\Local\Temp\tmpd5_o053z\jygnbt31.json init=C:\Users\TUYEN~1.NGU\AppData\Local\Temp\tmpd5_o053z\s8jj1qt3.json output file=C:\Users\TUYEN~1.NGU\AppData\Local\Temp\tmpd5_o053z\prophet_model7mcrcczm\prophet_model-20240424120047.csv method=optimize algorithm=newton iter=10000' failed:
@RikiSot
Copy link

RikiSot commented Apr 26, 2024

I'm also getting the same error. It seems there is a problem with cmdstanpy package

cmdstanpy - ERROR - Chain [1] error: terminated by signal 3221225657

I'm using Prophet 1.1.5 and Python 3.12.

EDIT: There are more issues opened for this like #2456 , some people think this is related to the OS. I'm on Windows btw

@Tuyen92
Copy link
Author

Tuyen92 commented May 3, 2024

I'm on Window 11.
I attempted to downgrade Prophet from version 1.1.5 to 1.1.1, and installed holidays==0.18.0. But it didn't work, the same error persists.
I'm also using cmdstanpy==1.2.2

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

2 participants