尝试使用h中的h2o创建深度学习预测时出错。使用命令h2o.predict对大约三分之一的预测发生错误。以下是模型设置:
localH2O = h2o.init(ip = "localhost", port = 54321, startH2O = TRUE,max_mem_size='20g',nthreads=6)
model <- h2o.deeplearning(x = 2:100, y = 1, training_frame = x, l1 = 1e-5, l2 = 1e-5, epochs=500, hidden = c(800,800,100))
prediction <- h2o.predict(model, x[,2:100])
以下是发生和关闭的错误:
ERROR: Unexpected HTTP Status code: 500 Server Error (url = http://localhost:54321/99/Rapids)
java.lang.RuntimeException
[1] "water.MRTask.getResult(MRTask.java:505)"
[2] "water.MRTask.doAll(MRTask.java:379)"
[3] "water.MRTask.doAll(MRTask.java:375)"
[4] "water.rapids.ASTRowSlice.apply(ASTColSlice.java:123)"
[5] "water.rapids.ASTExec.exec(ASTExec.java:46)"
[6] "water.rapids.ASTTmpAssign.apply(ASTAssign.java:255)"
[7] "water.rapids.ASTTmpAssign.apply(ASTAssign.java:248)"
[8] "water.rapids.ASTExec.exec(ASTExec.java:46)"
[9] "water.rapids.Session.exec(Session.java:56)"
[10] "water.rapids.Exec.exec(Exec.java:63)"
[11] "water.api.RapidsHandler.exec(RapidsHandler.java:23)"
[12] "sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)"
[13] "sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)"
[14] "java.lang.reflect.Method.invoke(Method.java:497)"
[15] "water.api.Handler.handle(Handler.java:64)"
[16] "water.api.RequestServer.handle(RequestServer.java:644)"
[17] "water.api.RequestServer.serve(RequestServer.java:585)"
[18] "water.JettyHTTPD$H2oDefaultServlet.doGeneric(JettyHTTPD.java:617)"
[19] "water.JettyHTTPD$H2oDefaultServlet.doPost(JettyHTTPD.java:565)"
[20] "javax.servlet.http.HttpServlet.service(HttpServlet.java:755)"
[21] "javax.servlet.http.HttpServlet.service(HttpServlet.java:848)"
[22] "org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)"
Show Traceback
Rerun with Debug
Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
water.DException$DistributedException: from /127.0.0.1:54321; by class water.rapids.ASTRowSlice$1; class java.lang.NegativeArraySizeException: null Error in class(obj) <- "rs.scalar" : attempt to set an attribute on NULL
以下是我的系统架构。运行系统(“java -version”)给出:
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
这是sessionInfo()的输出:
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows Server 2008 R2 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=Danish_Denmark.1252 LC_CTYPE=Danish_Denmark.1252 LC_MONETARY=Danish_Denmark.1252
[4] LC_NUMERIC=C LC_TIME=Danish_Denmark.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] h2o_3.6.0.8 statmod_1.4.22 TTR_0.23-0 selectiveInference_1.1.1
[5] intervals_0.15.1 lars_1.2 glmnet_2.0-2 foreach_1.4.3
[9] Matrix_1.2-2 wq_0.4.4 zoo_1.7-12 skm_1.0.2
[13] stringi_1.0-1 devtools_1.9.1
loaded via a namespace (and not attached):
[1] Rcpp_0.12.2 magrittr_1.5 MASS_7.3-43 munsell_0.4.2 colorspace_1.2-6
[6] lattice_0.20-33 stringr_1.0.0 plyr_1.8.3 xts_0.9-7 tools_3.2.2
[11] grid_3.2.2 gtable_0.1.2 iterators_1.0.8 digest_0.6.8 reshape2_1.4.1
[16] ggplot2_1.0.1 bitops_1.0-6 codetools_0.2-14 RCurl_1.95-4.7 memoise_0.2.1
[21] scales_0.3.0 jsonlite_0.9.19 proto_0.3-10
任何帮助都非常感激。
答案 0 :(得分:0)
您遇到的错误源自内部H2O语言处理框架(称为Rapids)。
可能的罪魁祸首不是预测,而是片段
x[,2:100]
哪个应进行列切片(ASTColSlice)。但看起来它正在ASTRowSlice中执行代码......如果能够提供任何日志,可以更好地处理正在发生的事情(stdout / err help,你可以用方法获取它们
h2o.downloadAllLogs
最突出的一点是:
Error in class(obj) <- "rs.scalar" : attempt to set an attribute on NULL
“rs.scalar”在我们的R代码中没有任何意义,你能识别它吗?无论如何,日志应该更多地说明NegativeArraySizeException的发生方式。
谢谢!