3

我正在尝试通过 R 在 H2O 中运行 gbm 模型并得到以下错误之一:

  |==========================                                                                               |  25%
Polling fails:
<simpleError in .h2o.__poll(client, job_key): Got exception 'class java.lang.RuntimeException', with msg 'java.lang.AssertionError: NewChunk.dst.len = 0, oc._len = 1235'
java.lang.RuntimeException: java.lang.AssertionError: NewChunk.dst.len = 0, oc._len = 1235
    at hex.FrameExtractor.getResult(FrameExtractor.java:77)
    at water.util.CrossValUtils.crossValidate(CrossValUtils.java:29)
    at hex.gbm.GBM.execImpl(GBM.java:201)
    at water.Func.exec(Func.java:42)
    at water.Job$3.compute2(Job.java:333)
    at water.H2O$H2OCountedCompleter.compute(H2O.java:647)
    at jsr166y.CountedCompleter.exec(CountedCompleter.java:429)
    at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
    at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
    at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
    at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Caused by: java.lang.AssertionError: NewChunk.dst.len = 0, oc._len = 1235
    at water.fvec.ChunkSplitter.extractChunkPart(ChunkSplitter.java:44)
    at hex.NFoldFrameExtractor$FoldExtractTask.map(NFoldFrameExtractor.java:105)
    at water.MRTask2.compute2(MRTask2.java:404)
    ... 6 more
>
  |=========================================================================================================| 100%
Error in .h2o.__remoteSend(data@h2o, model_view, `_modelKey` = xvalKey[i]) : 
  http://127.0.0.1:54321/2/GBMModelView.json  returned the following error:
   Model 'GBM_a1b17d68e29d7ba49cb6243293344b69_xval0' not found!

或者这个版本:

  |===================                                                         |  25%
Polling fails:
<simpleError in .h2o.__poll(client, job_key): Got exception 'class java.lang.AssertionError', with msg 'null'
java.lang.AssertionError
    at hex.gbm.GBM.buildNextKTrees(GBM.java:505)
    at hex.gbm.GBM.buildModel(GBM.java:296)
    at hex.gbm.GBM.buildModel(GBM.java:26)
    at hex.gbm.SharedTreeModelBuilder.buildModel(SharedTreeModelBuilder.java:276)
    at hex.gbm.GBM.execImpl(GBM.java:200)
    at water.Func.exec(Func.java:42)
    at water.Job.invoke(Job.java:353)
    at water.Job$ValidatedJob.genericCrossValidation(Job.java:889)
    at hex.gbm.GBM.crossValidate(GBM.java:709)
    at water.util.CrossValUtils.crossValidate(CrossValUtils.java:32)
    at hex.gbm.GBM.execImpl(GBM.java:201)
    at water.Func.exec(Func.java:42)
    at water.Job$3.compute2(Job.java:333)
    at water.H2O$H2OCountedCompleter.compute(H2O.java:647)
    at jsr166y.CountedCompleter.exec(CountedCompleter.java:429)
    at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
    at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
    at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
    at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
>
  |============================================================================| 100%
Error in tail(res$cms, 1)[[1]] : subscript out of bounds

这是导致错误的行:

  dat1.gbm <- h2o.gbm(y = 'click_target2', x = xVars, data = train1.hex
                      , nfolds = 3
                      , importance = T
                      , distribution = 'bernoulli' 
                      , n.trees = 200
                      , interaction.depth = 10,
                      # , n.minobsinnode = 2
                      , shrinkage = 0.01
  )

关于导致此错误的任何建议?

编辑:

我一直在尝试诊断 csv 文件本身是否存在问题,看来这可能是问题所在。我最终在 python 中编写了一个脚本,以将大文件按 week_number 分解为单个 csv 文件。通过读取文件大约 2/3 的方式我得到一个 NULL 字节异常错误。我仍在努力寻找解决此问题的方法。

4

3 回答 3

1

我看到错误发生在 crossValidate() 方法中。最新版本的 H2O (H2O-3) 中的交叉验证实现已被重写。

从这里尝试最新的稳定版本:http: //h2o.ai/download

但是我看不到如何访问原始帖子中任何地方的数据,所以我无法验证问题是否真正得到解决。

于 2015-09-03T19:24:38.480 回答
0

我也遇到了错误Error: java.lang.AssertionError:,对我有用的修复程序是enable_assertions = FALSEh2o.init.

library(h2o)
h2o.init(nthreads = 12, max_mem_size = "64g", enable_assertions = FALSE)

从 h2o 文档中:

enable_assertions:(可选)一个逻辑值,指示是否应在启用断言的情况下启动 H2O。这主要用于错误检查和调试目的。

于 2019-10-27T23:07:29.737 回答
0

尝试重新安装您的 java ( https://java.com/en/download/windows-64bit.jsp )。我对 H2O-3.20.0.1 也有同样的问题,它对我有用!

于 2018-06-11T02:26:13.553 回答