简体   繁体   English

R先知在循环中崩溃了Rstudio

[英]R Prophet crashing Rstudio in loop

I've been using prophet in R on windows for several months now and have recently started seeing random RStudio crashes. 我已经在Windows的R中使用先知了几个月了,最近开始看到随机的RStudio崩溃。 Prior to a few days ago, I was having no issues. 几天前,我没有任何问题。 I know that's not much to go off of, but I'm hoping someone can recognize what might be going on with my system. 我知道这还不算什么,但我希望有人能够认识到我的系统可能正在发生什么。 I've noticed that it crashes more frequently when n.changepoints is higher than the default of 25. 我注意到,当n.changepoints高于默认值25时,它崩溃的频率更高。

I see the crashes on both R 3.4 and 3.5. 我看到R 3.4和3.5都崩溃了。 I have Rtools installed properly and can compile cpp code inline as documented in the Rstan installation. 我已经正确安装了Rtools,并且可以按照Rstan安装中的说明内联编译cpp代码

Here is in the system that I'm working on. 这是我正在研究的系统。 I have the latest version of prophet and Rcpp. 我拥有最新版本的先知和Rcpp。

> sessionInfo()
R version 3.5.0 (2018-04-23)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server >= 2012 x64 (build 9200)

Matrix products: default

locale:
[1] C

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

other attached packages:
 [1] healthcareai_2.0.0 bindrcpp_0.2.2     odbc_1.1.6         reshape2_1.4.3     rmarkdown_1.10     prophet_0.3.0.1    Rcpp_0.12.17       lubridate_1.7.4   
 [9] dbplyr_1.2.1       forcats_0.3.0      stringr_1.3.1      dplyr_0.7.5        purrr_0.2.5        readr_1.1.1        tidyr_0.8.1        tibble_1.4.2      
[17] ggplot2_2.2.1      tidyverse_1.2.1    DBI_1.0.0         

loaded via a namespace (and not attached):
 [1] nlme_3.1-137       bit64_0.9-7        dimRed_0.1.0       httr_1.3.1         rprojroot_1.3-2    rstan_2.17.3       tools_3.5.0        backports_1.1.2   
 [9] utf8_1.1.4         R6_2.2.2           rpart_4.1-13       lazyeval_0.2.1     colorspace_1.3-2   nnet_7.3-12        withr_2.1.2        tidyselect_0.2.4  
[17] gridExtra_2.3      mnormt_1.5-5       bit_1.1-12         compiler_3.5.0     glmnet_2.0-16      cli_1.0.0          rvest_0.3.2        xml2_1.2.0        
[25] scales_0.5.0       sfsmisc_1.1-2      DEoptimR_1.0-8     psych_1.8.4        robustbase_0.93-1  digest_0.6.15      StanHeaders_2.17.2 foreign_0.8-70    
[33] pkgconfig_2.0.1    htmltools_0.3.6    rlang_0.2.1        readxl_1.1.0       ddalpha_1.3.4      MLmetrics_1.1.1    rstudioapi_0.7     bindr_0.1.1       
[41] jsonlite_1.5       ModelMetrics_1.1.0 inline_0.3.15      magrittr_1.5       Matrix_1.2-14      munsell_0.5.0      abind_1.4-5        stringi_1.1.7     
[49] yaml_2.1.19        MASS_7.3-49        plyr_1.8.4         recipes_0.1.3      grid_3.5.0         blob_1.1.1         pls_2.6-0          parallel_3.5.0    
[57] crayon_1.3.4       lattice_0.20-35    cowplot_0.9.2      haven_1.1.1        splines_3.5.0      hms_0.4.2          knitr_1.20         pillar_1.2.3      
[65] ranger_0.10.1      igraph_1.2.1       codetools_0.2-15   stats4_3.5.0       CVST_0.2-2         magic_1.5-8        glue_1.2.0         evaluate_0.10.1   
[73] data.table_1.11.4  modelr_0.1.2       foreach_1.4.4      cellranger_1.1.0   gtable_0.2.0       kernlab_0.9-26     assertthat_0.2.0   DRR_0.0.3         
[81] gower_0.1.2        prodlim_2018.04.18 broom_0.4.4        e1071_1.6-8        class_7.3-14       survival_2.41-3    geometry_0.3-6     timeDate_3043.102 
[89] RcppRoll_0.3.0     kknn_1.3.1         iterators_1.0.9    lava_1.6.1         caret_6.0-80       ipred_0.9-6  

Here is the code that I'm running. 这是我正在运行的代码。 It sometimes (1/5 times?) crashes Rstudio with a "session terminated" error. 有时(1/5次?)使R​​studio崩溃,并显示“会话终止”错误。

for (i in 1:length(f_names)) {
  d <- data_list[[i]]

  m <- prophet(df = d, 
               holidays = h_daily,
               n.changepoints = 100,
               changepoint.prior.scale = 100)

  future <- make_future_dataframe(m, periods = 14, freq = "day")

  f <- predict(m, future)
  forecast_list[[i]] <- f
}

If you've ever encountered something like this or know what I can do to give more info, please advise! 如果您遇到过类似情况,或者知道我该怎么做才能提供更多信息,请告知!

Edit: I'm using Rstudio 1.1.447. 编辑:我正在使用Rstudio 1.1.447。 This also happens in Rgui and R command line. Rgui和R命令行中也会发生这种情况。

This was traced to a problem with rlang 0.2.1 Installing version 0.2.0 or 0.2.2 fixed the issue for me and many others. 这被追溯到rlang 0.2.1的问题,安装了版本0.2.0或0.2.2为我和其他许多人解决了该问题。 Install a specific version with devtools::install_version("rlang", version="0.2.2") 使用devtools::install_version("rlang", version="0.2.2")安装特定版本

I encountered the same when i used it to forecast on daily basis, try to do forecast on monthly basis 我每天使用它进行预测时遇到相同的情况,尝试每月进行预测

make_future_dataframe(m, periods= , freq="month")

For daily basis forecasting, prophet package is not working properly 对于日常预报,先知套餐无法正常工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM