Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catching recompilation needed warning #74

Open
guiguem opened this issue Feb 14, 2018 · 0 comments
Open

catching recompilation needed warning #74

guiguem opened this issue Feb 14, 2018 · 0 comments

Comments

@guiguem
Copy link
Contributor

guiguem commented Feb 14, 2018

When a model has been compiled once with a different version of morpho/pyStan/python, the following error appears:

2018-02-14T19:47:49[WARNING ] pystan(369) -> No module named 'stanfit4anon_model_e8782a27df500e68b5c314485ddbc59a_1057640417982424343'
2018-02-14T19:47:49[WARNING ] pystan(370) -> Something went wrong while unpickling the StanModel. Consider recompiling.
2018-02-14T19:47:49[DEBUG   ] morpho(324) -> Using cached StanModel: ./morpho_test/cache/cached-model-e8782a27df500e68b5c314485ddbc59a.pkl
2018-02-14T19:47:49[INFO    ] morpho(331) -> Starting the sampling
2018-02-14T19:47:49[INFO    ] morpho(340) -> Parameters: 
data    [...]
chains  12
iter    4000
warmup  1000
thin    1
init    [...]
seed    36678357
algorithm       NUTS
n_jobs  2

2018-02-14T19:47:49[CRITICAL] morpho(648) -> Caught exception
Traceback (most recent call last):
  File "/build/bin/morpho", line 639, in <module>
    input_param, result = stan_cache(**(sa.gen_arg_dict()))
  File "/build/bin/morpho", line 342, in stan_cache
    return kwargs, sm.sampling(**kwargs)
  File "/build/lib/python3.6/site-packages/pystan/model.py", line 672, in sampling
    fit = self.fit_class(data, seed)
AttributeError: 'StanModel' object has no attribute 'fit_class'

We should try to catch it and force a recompilation of the model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant