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

'Enum' object has no attribute 'OPTIM' #52

Closed
Vfisa opened this issue Feb 28, 2017 · 5 comments
Closed

'Enum' object has no attribute 'OPTIM' #52

Vfisa opened this issue Feb 28, 2017 · 5 comments

Comments

@Vfisa
Copy link

Vfisa commented Feb 28, 2017

m.fit(df)

ERROR:main:'Enum' object has no attribute 'OPTIM'

pandas: 0.19.2
numpy: 1.12.0
fbprophet: 0.1.post1
pystan: 2.14.0.0
OSX Python 2.7

Thanks!

@seanjtaylor seanjtaylor added the bug label Mar 1, 2017
@seanjtaylor
Copy link
Contributor

Thanks for the bug report @Vfisa. Does it depend on the dataframe you pass in, or is for any dataframe? Would you mind sharing your input data?

@Vfisa
Copy link
Author

Vfisa commented Mar 1, 2017

Hi. thanks for a quick response!
I believe the issue is on my machine with P2.7, since it runs correctly on the corporate docker image (P3.6).

Sales data:
https://bitbucket.org/VFisa/kbc_forecasting_prophet/src/d4027c5ee48bf60bff4a7d5767f656e1034299c1/sales.csv?at=master&fileviewer=file-view-default

@bletham
Copy link
Contributor

bletham commented Mar 1, 2017

I'm unable to replicate the issue with those data, can you verify that pystan is working correctly?

>>> import pystan
>>> model_code = 'parameters {real y;} model {y ~ normal(0,1);}'
>>> model = pystan.StanModel(model_code=model_code)
>>> y = model.sampling(n_jobs=1).extract()['y']
>>> y.mean()  # with luck the result will be near 0

@Vfisa
Copy link
Author

Vfisa commented Mar 1, 2017

[Running] python "test_pystan.py"
INFO:pystan:COMPILING THE C++ CODE FOR MODEL anon_model_5944b02c79788fa0db5b3a93728ca2bf NOW.
Traceback (most recent call last):
File "test_pystan.py", line 4, in
y = model.sampling(n_jobs=1).extract()['y']
File "/Library/Python/2.7/site-packages/pystan/model.py", line 703, in sampling
control=control, **kwargs)
File "/Library/Python/2.7/site-packages/pystan/misc.py", line 484, in _config_argss
argss[i] = _get_valid_stan_args(argss[i])
File "/Library/Python/2.7/site-packages/pystan/misc.py", line 503, in _get_valid_stan_args
args['method'] = stan_args_method_t.SAMPLING
AttributeError: 'Enum' object has no attribute 'SAMPLING'

@seanjtaylor
Copy link
Contributor

This almost has to be a PyStan version problem.

https://github.com/stan-dev/pystan/blob/develop/pystan/constants.py#L19 is the current code in PyStan and it hasn't changed in over a year.

You should try to reinstall PyStan, and if it still is broken, file an issue with PyStan. Thanks!

@seanjtaylor seanjtaylor removed the bug label Mar 2, 2017
@Vfisa Vfisa closed this as completed Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants