prophet icon indicating copy to clipboard operation
prophet copied to clipboard

Error on fit

Open fernandohcardoso opened this issue 3 years ago • 22 comments

I've just installed prophet but It's not working when I try to fit.

14:11:57 - cmdstanpy - INFO - Chain [1] start processing
14:11:57 - cmdstanpy - INFO - Chain [1] done processing
14:11:57 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 3221225657 
Optimization terminated abnormally. Falling back to Newton.
14:11:58 - cmdstanpy - INFO - Chain [1] start processing
14:11:58 - cmdstanpy - INFO - Chain [1] done processing
14:11:58 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 3221225657 
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
~\anaconda3\lib\site-packages\prophet\models.py in fit(self, stan_init, stan_data, **kwargs)
    101         try:
--> 102             self.stan_fit = self.model.optimize(**args)
    103         except RuntimeError as e:

~\anaconda3\lib\site-packages\cmdstanpy\model.py in 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)
    730             else:
--> 731                 raise RuntimeError(msg)
    732         mle = CmdStanMLE(runset)

RuntimeError: Error during optimization: 

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
<ipython-input-12-ae8672abeabc> in <module>
      1 # Python
      2 m = Prophet()
----> 3 m.fit(df)

~\anaconda3\lib\site-packages\prophet\forecaster.py in fit(self, df, **kwargs)
   1169             self.params = self.stan_backend.sampling(stan_init, dat, self.mcmc_samples, **kwargs)
   1170         else:
-> 1171             self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
   1172 
   1173         self.stan_fit = self.stan_backend.stan_fit

~\anaconda3\lib\site-packages\prophet\models.py in fit(self, stan_init, stan_data, **kwargs)
    108                 )
    109                 args['algorithm'] = 'Newton'
--> 110                 self.stan_fit = self.model.optimize(**args)
    111             else:
    112                 raise e

~\anaconda3\lib\site-packages\cmdstanpy\model.py in 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)
    729                 get_logger().warning(msg)
    730             else:
--> 731                 raise RuntimeError(msg)
    732         mle = CmdStanMLE(runset)
    733         return mle

RuntimeError: Error during optimization: 

image

Could anyone help me?

fernandohcardoso avatar Jul 08 '22 17:07 fernandohcardoso

have the same problem, let me know if u fix it

fwong90 avatar Jul 25 '22 21:07 fwong90

I encountered this problem too.

zangyu00544 avatar Aug 09 '22 03:08 zangyu00544

I have got mine working.

I installed the cmdstanpy package and imported by using the following...

import cmdstanpy cmdstanpy.install_cmdstan() cmdstanpy.install_cmdstan(compiler=True) # only valid on Windows

Karlossal avatar Aug 10 '22 17:08 Karlossal

I install a new dev enviroment and install all packages again. It works for me 100%

Im using anaconda, in the menu, chose enviroments and create new one, then select it.

fwong90 avatar Aug 10 '22 17:08 fwong90

I install a new dev enviroment and install all packages again. It works for me 100%

Im using anaconda, in the menu, chose enviroments and create new one, then select it.

hey @fwong90 , I did same task which you listed out, it worked fine for me for the 1st time. But now after next day, when I am trying to run this, it again pops up with same error. After getting that same error, I tried removing an environment in which it was working. And tried same procedure by creating new environment. But now it is not working for me.

Any other solution ???

Akash-Jariwala avatar Sep 07 '22 04:09 Akash-Jariwala

+1

statkclee avatar Sep 21 '22 02:09 statkclee

Same problem here. I tried creating various new virtual environment, then typing pip install prophet but nothing worked

federicodecillia avatar Sep 29 '22 07:09 federicodecillia

Same problem

sscoo avatar Oct 06 '22 03:10 sscoo

I have the same problem. som additional info, i previously ran prophet in a conda environment and didn't have any issues. I recently changed from using conda envs to virtual envs and a brew python version and now it isn't working

motdam avatar Nov 10 '22 12:11 motdam

replace cmdstanpy version ,use pip install cmdstanpy==0.9.5 can resolve!!!!

lzxTopC avatar Nov 17 '22 07:11 lzxTopC

Nope still didn’t resolve the issue

replace cmdstanpy version ,use pip install cmdstanpy==0.9.5 can resolve!!!!

Karlossal avatar Nov 17 '22 08:11 Karlossal

In my case was weird. It works by installing cmdstanpy==0.9.5. But i got the following error in the process

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. prophet 1.1.1 requires cmdstanpy>=1.0.4, but you have cmdstanpy 0.9.5 which is incompatible.

Despite teh preivous error, my code run. Im running python 3.8.15 in a conda environment

sruap1214 avatar Nov 17 '22 14:11 sruap1214

yes,i known,but it can do work well,maybe is prophet is not mismatching cmdstanpy.

lzxTopC avatar Nov 18 '22 07:11 lzxTopC

I have got mine working.

I installed the cmdstanpy package and imported by using the following...

import cmdstanpy cmdstanpy.install_cmdstan() cmdstanpy.install_cmdstan(compiler=True) # only valid on Windows

This works for me, thanks!

oldrios avatar Dec 26 '22 14:12 oldrios

has anyone made this work on Mac M1? I am facing tough time making prophet work.

krishnapunyakoti avatar Jun 17 '23 17:06 krishnapunyakoti

Keep only one Python and uninstall the other thoroughly

sjfxking avatar Aug 12 '23 01:08 sjfxking

has anyone made this work on Mac M1? I am facing tough time making prophet work.

maybe try to run on Google Colab

sscoo avatar Aug 17 '23 12:08 sscoo

replace cmdstanpy version ,use pip install cmdstanpy==0.9.5 can resolve!!!!

This works for me! thank you!

cosmofan avatar Sep 26 '23 07:09 cosmofan

same problem, prophet==1.1.4,python=3.8,how to fix?

Bigchicken98 avatar Sep 28 '23 02:09 Bigchicken98

I have got mine working.

I installed the cmdstanpy package and imported by using the following...

import cmdstanpy cmdstanpy.install_cmdstan() cmdstanpy.install_cmdstan(compiler=True) # only valid on Windows

This works but for every new session I need to run it again and it takes several minutes. How can I avoid running and installing it again and again?

vivek-kumar007 avatar Jan 29 '24 13:01 vivek-kumar007