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

Upgrade Stan/PyStan to v2.19 #137

Open
guiguem opened this issue Aug 4, 2019 · 2 comments
Open

Upgrade Stan/PyStan to v2.19 #137

guiguem opened this issue Aug 4, 2019 · 2 comments

Comments

@guiguem
Copy link
Contributor

guiguem commented Aug 4, 2019

Is your feature request related to a problem? Please describe.
Access new features such as numerical integration

Describe the solution you'd like

Describe alternatives you've considered
We have had issues with upgrading things as compiled models tend to not run properly, need to reinvestigate this issue.

Additional context

@guiguem
Copy link
Contributor Author

guiguem commented Aug 7, 2019

Errors similar to what was seen in the past happen here too...

[root@0f7bb2cefb83 sampling]# python3 sampling_test.py SamplingTests.test_PyStan
2019-08-07T16:55:24[INFO    ] __main__(16) -> PyStanSampling test
2019-08-07T16:55:24[INFO    ] morpho.processors.BaseProcessor(50) -> Configure <pystanProcessor>
2019-08-07T16:55:24[DEBUG   ] morpho.processors.sampling.PyStanSamplingProcessor(254) -> seed = None
2019-08-07T16:55:24[INFO    ] morpho.processors.BaseProcessor(72) -> Run <pystanProcessor>...
/host/Project8/SourceTree/morpho/morpho/processors/sampling/PyStanSamplingProcessor.py:127: ResourceWarning: unclosed file <_io.TextIOWrapper name='model.stan' mode='r+' encoding='UTF-8'>
  theModel = open(self.model_code, 'r+').read()
2019-08-07T16:55:24[DEBUG   ] morpho.processors.sampling.PyStanSamplingProcessor(138) -> No functions file location given
2019-08-07T16:55:24[DEBUG   ] morpho.processors.sampling.PyStanSamplingProcessor(161) -> Import function files: complete
2019-08-07T16:55:24[DEBUG   ] morpho.processors.sampling.PyStanSamplingProcessor(177) -> Trying to load cached StanModel
2019-08-07T16:55:24[DEBUG   ] morpho.processors.sampling.PyStanSamplingProcessor(180) -> None exists -> creating Stan cache
2019-08-07T16:55:24[DEBUG   ] pystan(169) -> Successfully parsed Stan model 'anon_model_add5de6cfa753066e2255c6fea849b7e'.
2019-08-07T16:55:24[INFO    ] pystan(242) -> COMPILING THE C++ CODE FOR MODEL anon_model_add5de6cfa753066e2255c6fea849b7e NOW.
E
======================================================================
ERROR: test_PyStan (__main__.SamplingTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/host/Project8/SourceTree/morpho/morpho/processors/sampling/PyStanSamplingProcessor.py", line 178, in _stan_cache
    self.stanModel = pickle.load(open(cache_fn, 'rb'))
FileNotFoundError: [Errno 2] No such file or directory: './cached-anon_model-add5de6cfa753066e2255c6fea849b7e.pkl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/unixccompiler.py", line 128, in _compile
    extra_postargs)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/ccompiler.py", line 909, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/spawn.py", line 36, in spawn
    _spawn_posix(cmd, search_path, dry_run=dry_run)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/spawn.py", line 159, in _spawn_posix
    % (cmd, exit_status))
distutils.errors.DistutilsExecError: command 'gcc' failed with exit status 4

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "sampling_test.py", line 34, in test_PyStan
    self.assertTrue(pystanProcessor.Run())
  File "/host/Project8/SourceTree/morpho/morpho/processors/BaseProcessor.py", line 73, in Run
    if not self.InternalRun():
  File "/host/Project8/SourceTree/morpho/morpho/processors/sampling/PyStanSamplingProcessor.py", line 271, in InternalRun
    self._stan_cache()
  File "/host/Project8/SourceTree/morpho/morpho/processors/sampling/PyStanSamplingProcessor.py", line 181, in _stan_cache
    self._create_and_save_model(theModel, cache_fn)
  File "/host/Project8/SourceTree/morpho/morpho/processors/sampling/PyStanSamplingProcessor.py", line 186, in _create_and_save_model
    self.stanModel = pystan.StanModel(model_code=theModel)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/site-packages/pystan/model.py", line 349, in __init__
    build_extension.run()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/command/build_ext.py", line 339, in run
    self.build_extensions()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
    self._build_extensions_serial()
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
    self.build_extension(ext)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/command/build_ext.py", line 533, in build_extension
    depends=ext.depends)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/distutils/unixccompiler.py", line 130, in _compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'gcc' failed with exit status 4

----------------------------------------------------------------------
Ran 1 test in 204.963s

FAILED (errors=1)

@guiguem
Copy link
Contributor Author

guiguem commented Aug 7, 2019

Possible solution: switch to python 3.6.5
https://github.com/stan-dev/pystan/issues/489

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

No branches or pull requests

1 participant