paul-buerkner / brms

brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan
https://paul-buerkner.github.io/brms/
GNU General Public License v2.0
1.28k stars 182 forks source link

Error occurred during calling the sampler (MacOS Catalina) #854

Closed nahorp closed 4 years ago

nahorp commented 4 years ago

Hello,

I updated to the recent brms version (2.12.0) but unfortunately get this error,

>   fit <- brm(y ~ 1 + T + (1|I),
+                family = Gamma(link = "log"),
+                data = df_data)
Compiling the C++ model
Start sampling

SAMPLING FOR MODEL '5888262f96a4ea90ec5cec0c33ee8838' NOW (CHAIN 1).
Chain 1: 
Chain 1: Gradient evaluation took 0.002005 seconds
Chain 1: 1000 transitions using 10 leapfrog steps per transition would take 20.05 seconds.
Chain 1: Adjust your expectations accordingly!
Chain 1: 
Chain 1: 
[1] "Error in sampler$call_sampler(args_list[[i]]) : "
[2] "  c++ exception (unknown reason)"                
error occurred during calling the sampler; sampling not done

My sessioninfo is as below,

> sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.3

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] brms_2.12.0     Rcpp_1.0.3      forcats_0.4.0   stringr_1.4.0   dplyr_0.8.4     purrr_0.3.3    
 [7] readr_1.3.1     tidyr_1.0.2     tibble_2.1.3    ggplot2_3.2.1   tidyverse_1.3.0

loaded via a namespace (and not attached):
 [1] nlme_3.1-144         matrixStats_0.55.0   fs_1.3.1             xts_0.12-0          
 [5] lubridate_1.7.4      threejs_0.3.3        httr_1.4.1           rstan_2.19.3        
 [9] tools_3.6.2          backports_1.1.5      R6_2.4.1             DT_0.12             
[13] DBI_1.1.0            lazyeval_0.2.2       colorspace_1.4-1     withr_2.1.2         
[17] prettyunits_1.1.1    processx_3.4.2       tidyselect_1.0.0     gridExtra_2.3       
[21] Brobdingnag_1.2-6    compiler_3.6.2       cli_2.0.1            rvest_0.3.5         
[25] xml2_1.2.2           shinyjs_1.1          colourpicker_1.0     scales_1.1.0        
[29] dygraphs_1.1.1.6     mvtnorm_1.1-0        callr_3.4.2          ggridges_0.5.2      
[33] StanHeaders_2.21.0-1 digest_0.6.25        base64enc_0.1-3      pkgconfig_2.0.3     
[37] htmltools_0.4.0      sessioninfo_1.1.1    dbplyr_1.4.2         fastmap_1.0.1       
[41] htmlwidgets_1.5.1    rlang_0.4.4          readxl_1.3.1         rstudioapi_0.11     
[45] shiny_1.4.0          generics_0.0.2       zoo_1.8-7            jsonlite_1.6.1      
[49] crosstalk_1.0.0      gtools_3.8.1         inline_0.3.15        magrittr_1.5        
[53] loo_2.2.0            bayesplot_1.7.1      Matrix_1.2-18        munsell_0.5.0       
[57] fansi_0.4.1          abind_1.4-5          lifecycle_0.1.0      stringi_1.4.6       
[61] pkgbuild_1.0.6       plyr_1.8.5           grid_3.6.2           parallel_3.6.2      
[65] promises_1.1.0       crayon_1.3.4         miniUI_0.1.1.1       lattice_0.20-40     
[69] haven_2.2.0          hms_0.5.3            ps_1.3.2             pillar_1.4.3        
[73] igraph_1.2.4.2       markdown_1.1         shinystan_2.5.0      codetools_0.2-16    
[77] stats4_3.6.2         reshape2_1.4.3       rstantools_2.0.0     reprex_0.3.0        
[81] glue_1.3.1           packrat_0.5.0        modelr_0.1.6         vctrs_0.2.3         
[85] httpuv_1.5.2         cellranger_1.1.0     gtable_0.3.0         assertthat_0.2.1    
[89] mime_0.9             xtable_1.8-4         broom_0.5.4          coda_0.19-3         
[93] later_1.0.0          rsconnect_0.8.16     shinythemes_1.1.2    bridgesampling_1.0-0

I've seen some threads on the Stan discourse but not exactly sure how to proceed. Any help would be appreciated, thank you.

paul-buerkner commented 4 years ago

Unfortunately, this happens at a deeper level than brms and so discourse is the right place to look for answers.

kklot commented 8 months ago

Running this brms's example gives the same problem. Using native clang, and examples from stan run fine.

R version 4.3.2 (2023-10-31)
Platform: aarch64-apple-darwin20 (64-bit)
Running under: macOS Sonoma 14.2

Matrix products: default
BLAS:   [/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib) 
LAPACK: [/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib](https://file+.vscode-resource.vscode-cdn.net/Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib);  LAPACK version 3.11.0

locale:
[1] C

time zone: Europe/Berlin
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] ktools_1.0         rstan_2.32.5       StanHeaders_2.32.5 brms_2.20.4       
 [5] Rcpp_1.0.11        here_1.0.1         readr_2.1.4        stringr_1.5.1     
 [9] haven_2.5.4        tidyr_1.3.0        dplyr_1.1.4        ggplot2_3.4.4     

loaded via a namespace (and not attached):
  [1] RColorBrewer_1.1-3   tensorA_0.36.2.1     rstudioapi_0.15.0   
  [4] jsonlite_1.8.8       magrittr_2.0.3       farver_2.1.1        
  [7] fs_1.6.3             vctrs_0.6.5          memoise_2.0.1       
 [10] base64enc_0.1-3      htmltools_0.5.7      forcats_1.0.0       
 [13] usethis_2.2.2        distributional_0.3.2 mongolite_2.7.3     
 [16] htmlwidgets_1.6.4    desc_1.4.2           testthat_3.2.1      
 [19] plyr_1.8.9           zoo_1.8-12           cachem_1.0.8        
 [22] uuid_1.1-1           igraph_2.0.1.1       mime_0.12           
 [25] lifecycle_1.0.4      pkgconfig_2.0.3      colourpicker_1.3.0  
 [28] Matrix_1.6-1.1       R6_2.5.1             fastmap_1.1.1       
 [31] shiny_1.8.0          snakecase_0.11.1     digest_0.6.33       
 [34] colorspace_2.1-0     ps_1.7.5             rprojroot_2.0.4     
 [37] pkgload_1.3.3        crosstalk_1.2.1      labeling_0.4.3      
 [40] fansi_1.0.5          httr_1.4.7           abind_1.4-5         
 [43] compiler_4.3.2       remotes_2.4.2.1      bit64_4.0.5         
 [46] withr_2.5.2          backports_1.4.1      inline_0.3.19       
 [49] shinystan_2.6.0      QuickJSR_1.1.3       pkgbuild_1.4.2      
 [52] sessioninfo_1.2.2    gtools_3.9.5         loo_2.6.0           
 [55] tools_4.3.2          httpuv_1.6.12        threejs_0.3.3       
 [58] glue_1.6.2           callr_3.7.3          nlme_3.1-163        
 [61] promises_1.2.1       grid_4.3.2           pbdZMQ_0.3-10       
 [64] checkmate_2.3.1      reshape2_1.4.4       generics_0.1.3      
 [67] gtable_0.3.4         countrycode_1.5.0    tzdb_0.4.0          
 [70] hms_1.1.3            utf8_1.2.4           pillar_1.9.0        
 [73] markdown_1.12        IRdisplay_1.1        vroom_1.6.4         
 [76] posterior_1.5.0      later_1.3.1          lattice_0.21-9      
 [79] bit_4.0.5            tidyselect_1.2.0     miniUI_0.1.1.1      
 [82] gridExtra_2.3        stats4_4.3.2         bridgesampling_1.1-2
 [85] txtplot_1.0-4        brio_1.1.3           devtools_2.4.5      
 [88] matrixStats_1.1.0    DT_0.31              stringi_1.8.2       
 [91] codetools_0.2-19     evaluate_0.23        h3_3.7.2            
 [94] tibble_3.2.1         cli_3.6.1            RcppParallel_5.1.7  
 [97] IRkernel_1.3.2       shinythemes_1.2.0    xtable_1.8-4        
[100] repr_1.1.6           munsell_0.5.0        processx_3.8.2      
[103] coda_0.19-4          parallel_4.3.2       rstantools_2.4.0    
[106] ellipsis_0.3.2       prettyunits_1.2.0    dygraphs_1.1.1.6    
[109] profvis_0.3.8        urlchecker_1.0.1     bayesplot_1.11.0    
[112] Brobdingnag_1.2-9    mvtnorm_1.2-4        scales_1.3.0        
[115] xts_0.13.2           purrr_1.0.2          crayon_1.5.2        
[118] rlang_1.1.2          shinyjs_2.1.0
kklot commented 8 months ago

Use cmdstanr works now.

Running this brms's example gives the same problem. Using native clang, and examples from stan run fine.