H2O xgboost mojo预测警告

时间:2019-02-26 12:46:52

标签: r h2o

我正在尝试使用H2O中的XGBoost <html> <headers and css loads/> <body> <div class="container body-content"> @RenderBody() <hr /> <footer> </footer> </div> @Scripts.Render("~/bundles/jquery") @Scripts.Render("~/bundles/bootstrap") @RenderSection("scripts", required: false) </body></html> 对象根据新数据生成预测。不过,当我预测时,会显示各种警告信息

mojo

这是一个基本的可重现示例:

Feb 26, 2019 12:43:47 PM ml.dmlc.xgboost4j.java.NativeLibrary extractAndLoad
WARNING: Cannot load library from path lib/linux_64/libxgboost4j_gpu.so
Feb 26, 2019 12:43:47 PM ml.dmlc.xgboost4j.java.NativeLibrary extractAndLoad
WARNING: Cannot load library from path lib/libxgboost4j_gpu.so
Feb 26, 2019 12:43:47 PM ml.dmlc.xgboost4j.java.NativeLibrary doLoad
WARNING: Failed to load library from both native path and jar!
Feb 26, 2019 12:43:47 PM ml.dmlc.xgboost4j.java.NativeLibraryLoaderChain loadNativeLibs
INFO: Cannot load library: xgboost4j_gpu (lib/linux_64/libxgboost4j_gpu.so)
Feb 26, 2019 12:43:47 PM ml.dmlc.xgboost4j.java.NativeLibrary extractAndLoad
INFO: Loaded library from lib/linux_64/libxgboost4j_omp.so (/tmp/libxgboost4j_omp7945713229272382570.so)

       predict          setosa      versicolor       virginica
1       setosa 0.9961976408958 0.0030118888244 0.0007904054946
2       setosa 0.9963765740395 0.0026796606835 0.0009437160916
3       setosa 0.9963235855103 0.0028859297745 0.0007905053790
4       setosa 0.9963260293007 0.0028859369922 0.0007880008779
5       setosa 0.9961976408958 0.0030118888244 0.0007904054946

一旦我尝试执行预测,就会出现警告消息

library(tidyverse)
library(h2o)

h2o.init(nthreads = -1, max_mem_size = '5g') # All available cores

data(iris)
iris.hex <- as.h2o(iris, destination_frame = "iris.hex")

iris.gbm <- h2o.xgboost(y = 5, x = 1:4, training_frame = iris.hex, ntrees = 100,
                        max_depth = 3,
                        learn_rate = 0.2,
                        distribution= "AUTO")

h2o.download_mojo(iris.gbm, "Mojo_models/", get_genmodel_jar = T)
h2o.shutdown()

这是我应该担心的事情吗?如果没有,为什么会出现这些消息,我可以以某种方式抑制它们吗?

相关会话信息:

h2o.mojo_predict_df(iris, mojo_zip_path = "Mojo_models/XGBoost_model_R_1551184956713_1.zip", genmodel_jar_path = "Mojo_models/h2o-genmodel.jar", 
                    java_option =  '-Xmx1g -XX:ReservedCodeCacheSize=256m')

1 个答案:

答案 0 :(得分:0)

H2O正在尝试并且未能加载GPU版本XGBoost。然后加载CPU版本。除非您认为应该加载GPU版本,否则不必担心。