Closed juliagorman closed 9 months ago
PyStan 2.0 was last updated ~4 years ago and hasn't been officially supported since May of 2021. Are you able to use cmdstanpy or pystan3 ?
Unfortunately, the code I am running explicitly states you need to use pystan 2.0
GCC failing due to no space left on device
sounds like the code needlessly recompiles the model on every loop iteration.
The traceback suggests it happens on line 250 of ~/BHDMS/code/metric_HMDS.py
:
hmds_m = stan.StanModel(model_code=HMDS_code, verbose=False)
You could try and move that line to global scope (e.g. next to where HMDS_code
is defined) so the model gets compiled only once and hmds_m
can be reused.
Sorry, move what line to glocal scope?
The line with stan.StanModel(model_code=...)
, line 250 in file metric_HMDS.py
Alternatively change that line, i.e.
hmds_m = stan.StanModel(model_code=HMDS_code, verbose=False)
to
global hmds_m
if hmds_m is None:
hmds_m = stan.StanModel(model_code=HMDS_code, verbose=False)
and add to the start of the same file:
hmds_m = None
Further discussion of this is probably better on the Stan Forums
Summary:
I am running STAN code that requires pystan 2.0. I am trying to run a loop, but after a couple iterations (3-6), I get this error: CompileError: command '/usr/bin/gcc' failed with exit code 1. I then have to go back and restart the kernal and re-run the loop. I have gcc installed with version gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Reproducible Steps:
Here is my loop:
this line calls the stan code which looks like such:
Current Output:
The current output. Knowing what is the current behavior is useful.
Expected Output:
The expected output is just the array. It does still work just instead of running all the iterations it throws an error after several so I am still able to get some of the values
Current Version:
v2.34.1