Open hhau opened 6 years ago
Thanks for reporting this and sorry for the hassle! You’re right that this seems hard to pin down. I don’t think this is the first time this has been reported but not something I’ve ever been able to reproduce. Please do keep us posted if you figure anything out. You might also try asking on the Stan Forums (discourse.mc-stan.org) in case one of our users has experienced this and has any insights.
I have had issues where a Stan run that is aborted with C-c has redirected the R output to some file in the temporary directory, and then ALL errors from that R session are lost to the ether (well, actually they are printed into that file, and if you track that down with lsof, you can find them again). Could this be related?
I ran into this issue as well. I determined that in my case the problem likely stemmed from an out of memory issue. I had plenty of RAM (64gb), but i suspect somewhere a vector/array was being allocated with too many elements. In some cases when I encountered the problem nothing would be returned, but when I quit R (in the terminal) I would get Segmentation fault: 11
.
In particular I had 2 transformed parameters and ~6 generated quantities of length 53431. When I paired down the generated quantities to 1, the error went away.
Summary:
Running code such as
model_fit <- stan()
occasionally results in no assignment / output, despite Stan appearing to run normally. In fact the variablemodel_fit
does not exist in the environment.Description:
I call
rstan::stan()
with multiple chains from within Rstudio, and assign it to some variable. Upon the completion of the sampling process, either the assignment doesn't occur, or something goes awry in the return process.This might have something to do with:
fitter.R
file)I realise that this issue is going to be practically impossible to track down (and might even be specific to my environment), but I would feel remiss not to mention it here. (I'm also somewhat irked as I just lost a model that ran for 90,000 seconds :/ ).
Reproducible Steps:
I have attached the stan model with which I encountered the issue, as well as a script to generate data. (Unable to share data in R code detailed below), and the script used to fit the model.
2018-04-18_double-tanh-log-time-series.zip
I'm going to keep trying to reproduce this, and will update this thread if I can find something that breaks consistently.
Current Output:
If applicable, any relevant output from RStan.
I have attached the
stanprogress
file from thetempdir()
, which indicates that stan seemed to run and complete normally. filea2fc2f677584_StanProgress.txtExpected Output:
model_fit
to exist as astanfit
object, with samples. Or an error that indicates that the return process / assignment failed.RStan Version:
R Version:
Operating System:
Windows 7 Enterprise, SP1.