facebook / prophet

Tool for producing high quality forecasts for time series data that has multiple seasonality with linear or non-linear growth.
https://facebook.github.io/prophet
MIT License
18.53k stars 4.54k forks source link

RuntimeError: Error during optimization! #2629

Open xaviermurilo opened 1 month ago

xaviermurilo commented 1 month ago

Hi everyone, I'm getting this error trying to fit my Data Frame. I tried to use different versions of the library prophet, but in all cases getting the same error. I did a quickly review on the issues that others have found but different users found different solutions, i tried figure out how to solve, but without good results.

Environment: Python 3.12 prophet==1.1.4 holidays==0.32 cmdstanpy==1.2.4

df structure :

        ds          y

0 2022-06-02 -188719.00 1 2022-06-03 -77518.00 2 2022-06-04 105109.00 3 2022-06-05 -34873.00 4 2022-06-08 -22407.00

My log at this moment is:

INFO:prophet:Disabling yearly seasonality. Run prophet with yearly_seasonality=True to override this. INFO:prophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this. DEBUG:cmdstanpy:input tempfile: C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\xkyce9lj.json DEBUG:cmdstanpy:input tempfile: C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\q2yyhsm8.json DEBUG:cmdstanpy:idx 0 DEBUG:cmdstanpy:running CmdStan, num_threads: None DEBUG:cmdstanpy:CmdStan args: ['C:\Users\MuriloXavierDeSousa\PycharmProjects\learn\.venv\Lib\site-packages\prophet\stan_model\prophet_model.bin', 'random', 'seed=14426', 'data', 'file=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\xkyce9lj.json', 'init=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\q2yyhsm8.json', 'output', 'file=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\prophet_model76sf41x6\prophet_model-20241009102001.csv', 'method=optimize', 'algorithm=lbfgs', 'iter=10000'] 10:20:01 - cmdstanpy - INFO - Chain [1] start processing INFO:cmdstanpy:Chain [1] start processing 10:20:01 - cmdstanpy - INFO - Chain [1] done processing INFO:cmdstanpy:Chain [1] done processing 10:20:01 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 3221225657 ERROR:cmdstanpy:Chain [1] error: terminated by signal 3221225657 WARNING:prophet.models:Optimization terminated abnormally. Falling back to Newton. DEBUG:cmdstanpy:input tempfile: C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\ttixvi4d.json DEBUG:cmdstanpy:input tempfile: C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\gagvaw1m.json DEBUG:cmdstanpy:idx 0 DEBUG:cmdstanpy:running CmdStan, num_threads: None DEBUG:cmdstanpy:CmdStan args: ['C:\Users\MuriloXavierDeSousa\PycharmProjects\learn\.venv\Lib\site-packages\prophet\stan_model\prophet_model.bin', 'random', 'seed=5620', 'data', 'file=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\ttixvi4d.json', 'init=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\gagvaw1m.json', 'output', 'file=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\prophet_model_gu0c5sw\prophet_model-20241009102001.csv', 'method=optimize', 'algorithm=newton', 'iter=10000'] 10:20:01 - cmdstanpy - INFO - Chain [1] start processing INFO:cmdstanpy:Chain [1] start processing 10:20:01 - cmdstanpy - INFO - Chain [1] done processing INFO:cmdstanpy:Chain [1] done processing 10:20:01 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 3221225657 ERROR:cmdstanpy:Chain [1] error: terminated by signal 3221225657 Traceback (most recent call last): File "C:\Program Files\JetBrains\PyCharm Community Edition 2024.1.4\plugins\python-ce\helpers\pydev_pydevd_bundle\pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, local_vars) File "", line 1, in File "C:\Users\MuriloXavierDeSousa\PycharmProjects\learn.venv\Lib\site-packages\prophet\forecaster.py", line 1181, in fit self.params = self.stan_backend.fit(stan_init, dat, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\MuriloXavierDeSousa\PycharmProjects\learn.venv\Lib\site-packages\prophet\models.py", line 97, in fit self.stan_fit = self.model.optimize(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\MuriloXavierDeSousa\PycharmProjects\learn.venv\Lib\site-packages\cmdstanpy\model.py", line 659, in optimize raise RuntimeError(msg) RuntimeError: Error during optimization! Command 'C:\Users\MuriloXavierDeSousa\PycharmProjects\learn.venv\Lib\site-packages\prophet\stan_model\prophet_model.bin random seed=5620 data file=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\ttixvi4d.json init=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\gagvaw1m.json output file=C:\Users\MURILO~1\AppData\Local\Temp\tmp5eionmg2\prophet_model_gu0c5sw\prophet_model-20241009102001.csv method=optimize algorithm=newton iter=10000' failed:

jamesdeluk commented 2 weeks ago

I have the same issue, except the identical code works in Google Colab.