1.1.5 Breaks working code - "Error during optimization!"
- Dominant language
- Python
- Stars
- 20.4k
- Forks
- 4.6k
- Avg merge
- 19h 52m
- Merged PRs (30d)
- 1
Description
Hello,
Thank you for your support of this project.
Environment:
- Mac with M2 Pro running Sonoma 14.0
- Docker running a week-old Jupyter/datascience-notebook:latest image in AMD64 emulation with limited other package installs
- Python 3.11, as a result of above.
The python code:
```python
temp = aaaed[:'2020-01-31'].reset_index()
m = Prophet(seasonality_mode='multiplicative')
m.fit(temp)
future = m.make_future_dataframe(periods=731)
forecast = m.predict(future)
```
now fails with the error text below.
Simple, toy data also fails with default settings. so far, m.fit() has not worked for me at all in 1.1.5.
m.preprocess does work though (lol!)
rollback to 1.1.4 restores code function.
```python
03:29:57 - cmdstanpy - INFO - Chain [1] start processing
03:29:57 - cmdstanpy - INFO - Chain [1] done processing
03:29:57 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 11 Unknown error -11
Optimization terminated abnormally. Falling back to Newton.
03:29:57 - cmdstanpy - INFO - Chain [1] start processing
03:29:57 - cmdstanpy - INFO - Chain [1] done processing
03:29:57 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 11 Unknown error -11
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
File /opt/conda/lib/python3.11/site-packages/prophet/models.py:121, in CmdStanPyBackend.fit(self, stan_init, stan_data, **kwargs)
120 try:
--> 121 self.stan_fit = self.model.optimize(**args)
122 except RuntimeError as e:
123 # Fall back on Newton
File /opt/conda/lib/python3.11/site-packages/cmdstanpy/model.py:738, in CmdStanModel.optimize(self, data, seed, inits, output_dir, sig_figs, save_profile, algorithm, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, history_size, iter, save_iterations, require_converged, show_console, refresh, time_fmt, timeout)
737 else:
--> 738 raise RuntimeError(msg)
739 mle = CmdStanMLE(runset)
RuntimeError: Error during optimization! Command '/opt/conda/lib/python3.11/site-packages/prophet/stan_model/prophet_model.bin random seed=13195 data file=/tmp/tmpaajvr7zp/8h9qf2n_.json init=/tmp/tmpaajvr7zp/_qv49cs9.json output file=/tmp/tmpaajvr7zp/prophet_modelsrj0hzs5/prophet_model-20231021032957.csv method=optimize algorithm=lbfgs iter=10000' failed:
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
Cell In[10], line 4
1 temp = aaaed[:'2020-01-31'].reset_index().copy()
3 m = Prophet(seasonality_mode='multiplicative')
----> 4 m.fit(temp)
5 future = m.make_future_dataframe(periods=731)
6 forecast = m.predict(future)
File /opt/conda/lib/python3.11/site-packages/prophet/forecaster.py:1232, in Prophet.fit(self, df, **kwargs)
1230 self.params = self.stan_backend.sampling(stan_init, dat, self.mcmc_samples, **kwargs)
1231 else:
-> 1232 self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
1234 self.stan_fit = self.stan_backend.stan_fit
1235 # If no changepoints were requested, replace delta with 0s
File /opt/conda/lib/python3.11/site-packages/prophet/models.py:128, in CmdStanPyBackend.fit(self, stan_init, stan_data, **kwargs)
126 logger.warning('Optimization terminated abnormally. Falling back to Newton.')
127 args['algorithm'] = 'Newton'
--> 128 self.stan_fit = self.model.optimize(**args)
129 params = self.stan_to_dict_numpy(
130 self.stan_fit.column_names, self.stan_fit.optimized_params_np)
131 for par in params:
File /opt/conda/lib/python3.11/site-packages/cmdstanpy/model.py:738, in CmdStanModel.optimize(self, data, seed, inits, output_dir, sig_figs, save_profile, algorithm, init_alpha, tol_obj, tol_rel_obj, tol_grad, tol_rel_grad, tol_param, history_size, iter, save_iterations, require_converged, show_console, refresh, time_fmt, timeout)
736 get_logger().warning(msg)
737 else:
--> 738 raise RuntimeError(msg)
739 mle = CmdStanMLE(runset)
740 return mle
RuntimeError: Error during optimization! Command '/opt/conda/lib/python3.11/site-packages/prophet/stan_model/prophet_model.bin random seed=73218 data file=/tmp/tmpaajvr7zp/y6ybf0ok.json init=/tmp/tmpaajvr7zp/1dlowjn8.json output file=/tmp/tmpaajvr7zp/prophet_modelfkn1kqc4/prophet_model-20231021032957.csv method=optimize algorithm=newton iter=10000' failed:
```
Contributor guide
Assessment
This issue has not been assessed yet.