RuntimeError: Error during optimization!

Open
#2,629 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
python

Research direction

Reproduce the fit using the listed Python, Prophet, holidays, and cmdstanpy versions and the complete DataFrame, then start at prophet/forecaster.py:1181 and prophet/models.py:97. Check whether the Windows CmdStan process termination is caused by the input data or environment; done requires a confirmed cause and a minimal reproducible case or documented fix.

Written by the indexing model from the issue text.

Description

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\MURILO1\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\MURILO1\AppData\Local\Temp\tmp5eionmg2\xkyce9lj.json', 'init=C:\Users\MURILO1\AppData\Local\Temp\tmp5eionmg2\q2yyhsm8.json', 'output', 'file=C:\Users\MURILO1\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\MURILO1\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\MURILO1\AppData\Local\Temp\tmp5eionmg2\gagvaw1m.json', 'output', 'file=C:\Users\MURILO1\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\MURILO1\AppData\Local\Temp\tmp5eionmg2\ttixvi4d.json init=C:\Users\MURILO1\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:

Dominant language
Python
Stars
20.5k
Forks
4.6k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebook/prophet

All issues in facebook/prophet

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.