xgboost: Model produced in 1.0.0 cannot be loaded into 0.90
Following the instructions here: https://xgboost.readthedocs.io/en/latest/R-package/xgboostPresentation.html
> install.packages("drat", repos="https://cran.rstudio.com")
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/drat_0.1.5.zip'
Content type 'application/zip' length 87572 bytes (85 KB)
downloaded 85 KB
package ‘drat’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\lee\AppData\Local\Temp\RtmpiE0N3D\downloaded_packages
> drat:::addRepo("dmlc")
> install.packages("xgboost", repos="http://dmlc.ml/drat/", type = "source")
Warning: unable to access index for repository http://dmlc.ml/drat/src/contrib:
Line starting '<!DOCTYPE html> ...' is malformed!
Warning message:
package ‘xgboost’ is not available (for R version 3.6.0)
It also fails on R 3.6.2 with the same error.
Note: I would much prefer to use the CRAN version. But models I train on linux and Mac and save using the saveRDS function don’t predict on another system (windows), they just produce numeric(0). If anyone has any guidelines on how to save an XGBoost model for use on other computers, please let me know. I’ve tried xgb.save.raw and xgb.load - both produce numeric(0) as well. But on the computer I trained the model on (a month ago), readRDS in R works just fine. Absolutely baffling to me.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 74 (22 by maintainers)
I’ve successfully reproduced the issue on linux - see attached screenshot.
I am uploading the virtual box to dropbox. But in case you’d prefer to install from scratch, instructions to replicate are as follows:
install.packages(c("caret", "xgboost"))6. load packages in RAnd this returned the now familiar:
note: I tried explicit calling libraries, and just trying the prediction. Both resulted in the same numeric(0) response.
Hi, I’m faced with similar issues with Python. I saved the model via xgboost 1.0.1, and loaded it via xgboost 0.9, and the predictions are empty lists. Since our production environment is using xgboost 0.9, I’m wondering if there’s any way I can load a saved-via-xgboost-1.0 model into xgboost 0.9?
@hetong007 Nice. Please tell Prof. Ripley thanks for taking time to debug the problem. I will go ahead and guard that line to only run in proper Linux environment only, since we only have proper testing facility to test XGBoost with Windows and Linux. Ideally, any non-standard C++ facilities should not be used unless they are first tested as part of CI. I will also have to scan the codebase for other non-standard C++ features and try to remove them as well. cc @trivialfis
@hcho3 Could you please try using
std::fillfirst? Even the compiler may not be able to optimize it intomemset, I don’t think it’s critical enough to have any visible performance impact.@hetong007 I just downloaded Solaris VM image from Oracle that can run with VirtualBox. Let me try to reproduce the issue.
@hcho3 Sounds good, given that we have a valid endian detection. I’ll make a submission in a week.