stan-dev / rstan

RStan, the R interface to Stan
https://mc-stan.org
1.02k stars 264 forks source link

Same model backend = "cmdstanr" not crashed but backend = "rstan" crashed in Rstudio; within the R console, both backends fine #1105

Closed joshua-zh closed 7 months ago

joshua-zh commented 7 months ago

I ran two of the same models using brms, the default backend = "rstan" caused rstudio to abort, then I changed to backend = "cmdstanr", and the same model ran well.

The data and the model comes from stan website

t_long_CNSubset20red1_sub3_ord = read.csv("https://discourse.mc-stan.org/uploads/short-zrl/byihhT2MGE2yXgTZB1pg93wPxio.csv")
t = brm(bf(y ~ mo(g_size) * mo(g_noise) * g_shape * g_interps), data = t_long_CNSubset20red1_sub3_ord, chains = 2, backend = "rstan") 

Rstudio popped up the R Session Aborted. Within the R console, the model ran well; By the way, the example ran without any problems in Rstudio.

example(stan_model, package="rstan", run.dontrun = TRUE, verbose = TRUE)
t = brm(bf(y ~ mo(g_size) * mo(g_noise) * g_shape * g_interps), data = t_long_CNSubset20red1_sub3_ord, chains = 2, backend = "cmdstanr") 

cmdstanr backend did not cause rstudio to crash.

Session information:

packageVersion("cmdstanr") [1] ‘0.6.1.9000’

packageVersion("brms") [1] ‘2.20.6’

packageVersion("rstan") [1] ‘2.33.1.9000’

R.version.string [1] "R version 4.3.1 (2023-06-16)"

MacOS 14.1 sonoma

joshua-zh commented 7 months ago

When I updated the R version to 4.3.2, the crash problem was solved.

joshua-zh commented 7 months ago

When I updated the R version to 4.3.2, the crash problem was solved.