【发布时间】:2017-11-11 00:21:43
【问题描述】:
当我尝试使用 H2O 3.12.01 在 Windows 7 和 Windows Server 2008R2 上通过 h2o.xgboost() 在 R 中运行 XGboost 时,我收到以下错误:
错误:java.lang.UnsatisfiedLinkError: ml.dmlc.xgboost4j.java.XGBoostJNI.XGDMatrixCreateFromCSREx([J[I[FI[J)I
这是一个可重现的例子:
library(h2o)
h2o.init(nthreads = -1)
h2o.no_progress() # Don't show progress bars in RMarkdown output
# Import a sample binary outcome train/test set into H2O
train <- h2o.importFile("https://s3.amazonaws.com/erin-data/higgs/higgs_train_10k.csv")
test <- h2o.importFile("https://s3.amazonaws.com/erin-data/higgs/higgs_test_5k.csv")
# Identify predictors and response
y <- "response"
x <- setdiff(names(train), y)
# For binary classification, response should be a factor
train[,y] <- as.factor(train[,y])
test[,y] <- as.factor(test[,y])
# Number of CV folds (to generate level-one data for stacking)
nfolds <- 5
# Train & Cross-validate a (shallow) XGB-GBM
my_xgb1 <- h2o.xgboost(x = x,
y = y,
training_frame = train,
distribution = "bernoulli",
ntrees = 50,
max_depth = 3,
min_rows = 2,
learn_rate = 0.2,
nfolds = nfolds,
fold_assignment = "Modulo",
keep_cross_validation_predictions = TRUE,
seed = 1)
R version 3.4.0 Patched (2017-05-19 r72713) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows Server 2008 R2 x64 (build 7601) Service Pack 1 Matrix products: default locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] h2o_3.12.0.1 loaded via a namespace (and not attached): [1] compiler_3.4.0 tools_3.4.0 RCurl_1.95-4.8 jsonlite_1.5 bitops_1.0-6
3.12.01是h2o.ai主页链接的最新开发版本,在3.10没找到这个功能后升级到了。但是,@MarcoSandri 的评论表明他们的 Amazon AWS 上有更新的开发版本 (3.13),因此下载了它并相应地升级了集群和 R 包。
从 3.12 升级到 3.13 似乎进展顺利,直到我尝试使用 h2o.xgboost() 函数。然后它抛出了一个不同的错误:
Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
ERROR MESSAGE: -1 Error in fetch(key) : lazy-load database 'E:/Program Files/R/R-3.4.0patched/library/h2o/help/h2o.rdb' is corrupt
【问题讨论】:
-
请发帖
sessionInfo()和java -version。尝试在此处安装最新的 h2o 版本:h2o-release.s3.amazonaws.com/h2o/master/3943/…(里面有一个 R 包) -
@MarcoSandri 当然,这是 3.12.01 版。他们的网站说这是最新的前沿开发版本,但我从你的链接中看到他们已经在开发 3.13,尽管官方版本仍然只有 3.9。我会继续尝试,谢谢。
-
@MarcoSandri 我已将集群和 R 包升级到 3.13,但现在它抛出了另一个错误。我会更新我的问题。
-
我明白了。我要求您更新软件包只是因为
h2o.xgboost在我的 Windows 7 PC 上生成了一个不同的错误。我可以看到现在我们有同样的错误。我正在努力寻找解决问题的方法。如果我发现一些有趣的事情,我会联系你。 -
截至 2017 年 7 月 1 日,H2O 中的 xgboost 尚不支持原生 Windows(因此预览版 3.12.0.1 和稳定版 3.10.5.3)。