prophet: Python3.7.0: Something went wrong while unpickling the StanModel. Consider recompiling.

OS: Windows 7 Professional

First of all, I have read through related threads #249 #252 and #599, but still cannot figure out how to solve this issue.

I understand that the easiest way to install fbprophet is to run conda install -c conda-forge fbprophet but for reasons I don’t know, it takes forever for conda to solve the environment. It’s not the case if I use conda to install other packages. So instead I used pip and it reported that fbprophet 0.4 was installed successfully. But I then got the following error message when importing fbprophet WARNING:pystan:No module named ‘stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_2841341000846931969’ WARNING:pystan:Something went wrong while unpickling the StanModel. Consider recompiling.

Before installing fbprophet, I followed this instruction to install pystan and checked that pystan is working properly. By running the following code. import pystan model_code = 'parameters {real y;} model {y ~ normal(0,1);}' model = pystan.StanModel(model_code=model_code) # this will take a minute y = model.sampling(n_jobs=1).extract()['y'] y.mean() # should be close to 0

I got message like

Gradient evaluation took 0 seconds 1000 transitions using 10 leapfrog steps per transition would take 0 seconds. Adjust your expectations accordingly!

Iteration: 1 / 2000 [ 0%] (Warmup) Iteration: 200 / 2000 [ 10%] (Warmup) Iteration: 400 / 2000 [ 20%] (Warmup) Iteration: 600 / 2000 [ 30%] (Warmup) Iteration: 800 / 2000 [ 40%] (Warmup) Iteration: 1000 / 2000 [ 50%] (Warmup) Iteration: 1001 / 2000 [ 50%] (Sampling) Iteration: 1200 / 2000 [ 60%] (Sampling) Iteration: 1400 / 2000 [ 70%] (Sampling) Iteration: 1600 / 2000 [ 80%] (Sampling) Iteration: 1800 / 2000 [ 90%] (Sampling) Iteration: 2000 / 2000 [100%] (Sampling)

Elapsed Time: 0.01 seconds (Warm-up) 0.01 seconds (Sampling) 0.02 seconds (Total)

I uninstalled both pystan and fbprophet and then reinstalled them with --no-cache flag. But fbprophet still didn’t work.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 33 (10 by maintainers)

Commits related to this issue

Most upvoted comments

This can happen when there is a change in the model (with a new version of fbprophet, or a new version of PyStan) and pip is still using a wheel that is compiled with the old version. We just pushed a new version of fbprophet to PyPI. This should fix the issue (without having to downgrade):

pip3 uninstall fbprophet
pip3 install fbprophet --no-cache-dir --no-binary :all:

Similar to @jiapei100 , I’m seeing this same issue with python 3.6.7, although I’m using Ubuntu 18.04 and pip to install.

I think this might be an issue with prophet 0.4, which strangely enough is listed on pypi, but not in Github as a release. It was also released yesterday.

Force downgrading to the version before seems to have before fixed things for me: pip3 install --upgrade --force-reinstall --no-cache fbprophet==0.3.post2.

I wonder if building from source might also fix things - the error message seems to suggest some prebuilt STAN model is broken.

Can this issue please be reopened? I’m seeing the same issue and had to pin to 0.3.post2.

It is still not working for me. Python 3.6.5, pystan 2.18.0.0, fbprophet 0.4 When trying to import fbprophet,

WARNING:pystan:No module named ‘stanfit4anon_model_861b75c6337e237650a61ae58c4385ef_2841341000846931969’ WARNING:pystan:Something went wrong while unpickling the StanModel. Consider recompiling.

The fix has been pushed to pypi.

pip install --upgrade fbprophet

will get things working.

Forcing fbprophet to 0.3.post2 worked for me as a fix.

Post release is out. Closing the issue.

Great! Thanks @bletham. It’s working.

I’ve just solved this problem before a minute by following this instruction to install gcc 64 to my computer: https://wiki.python.org/moin/WindowsCompilers Then create a new empty environment in Anaconda and install fbprophet directly by: conda install -c conda-forge fbprophet Finally it works, hope it can help 😃