Random crash when training several models in same R session.
I use xgboost from R with very big tables during several days and works fine, but I found that when I do several training in same session (like when I do bootstrapping in the training data and fit a model and do this 100 times sequentially) I get random crash. I tried to use gc() in each iteration, but doesn't work. I suspect the problem could be related with low level pointers / buffers that link R with C++ objects. Is there a way to clean all pointers / buffers used at low level by xgboost in R session? How to do a 'hard clean' or a 'reset' like you begin again from the scratch?
I am not sure whether "hard clean" can solve the problem with no further information. Instead of the "hard clean", I suggest to write a single training Rscript and run it by Rscript training.R in a sequence.
Is the crash very rare or reproducible? We are also interested in fixing it.
I've tried to find a toy data set and reproduce the crash, but this is random (sometime at iteration 6 and other times at 36). I experimented it in two different servers (xeon cpu and ECC registered memory) running exclusively xgboost. I'm the unique user of these servers and use them only for machine learning, sometimes during several days or more than a week, without problem, so this is why I thought the problem could be a low level link degradation between R and xgboost core. I'll use the 'script call' work around and will write each result to disk and then read form other script that do the bagging merge. Thank you.
What is the error you're getting? xgboost is crashing for me with a "This application has requested the Runtime to terminate in an unusual way" error at random times . I'm using xgb.cv in a loop for hyper-parameter tuning with 5 folds, nrounds = 5000. The crash occurs after some time - the 18th+ iteration of the loop. Any ideas? If this isn't the error you're getting, I'll open a separate thread.
Yes. Sometimes with this message, sometimes just a 'not responding' in task manager with CPU and memory monitor blocked.
Also, was it with xgb.cv or xgb.train?
Both. After running several models in same R session, randomly crash.
I'm going to try this in Python.
@bscheetz Did you tried it in Python?
I continue with crashing nearly every big model I try with xgb.cv. 10 folds and 20000 trees never ends, but failed at different points. No error message, only frozen. In console the CPU monitor remainds with a constant use of one core and the memory used by the process constant.
Someone experimenting the same?
sessionInfo():
R version 3.2.2 (2015-08-14) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 8 x64 (build 9200)
locale: [1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252 LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C LC_TIME=Spanish_Spain.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] xgboost_0.4-2 data.table_1.9.6
loaded via a namespace (and not attached): [1] magrittr_1.5 Matrix_1.2-2 tools_3.2.2 stringi_0.5-5 grid_3.2.2 stringr_1.0.0 chron_2.3-47 lattice_0.20-33
I still haven't gotten a chance to try it in python. Since models from R load in python, I don't have as much need to try it. If I get some time, I will work on it.
closing for now due to inactive status, feel free to reopen
Did you find any solution? I'm also experiencing the same issue. I'm fitting several models in a loop and my script always crashes on a random iteration.
I am also having the same issue. I call xgb.train() within a while loop, and it will crash randomly after some time. Not sure what it is, anyone encountering the same problem?
It would be much more useful if you could provide more context around those crashes. After what numbers of iterations does it usually happen? What is the size of your data? What is your system memory and what is the memory use when it crashes? The more info the better. You might also be creating objects in your script that accumulate during iterations. It might help to see some minimal code that still crashes for you.
I am having the same issue. When I am going to train xgb.train, my r session aborted. I am not able to find the solution anywhere. Any suggestion will be appreciated.