在H2O蒸汽预测服务生成器中使用MOJOS

时间:2017-09-21 21:42:14

标签: h2o

h2o的Steam预测服务构建器文档here中,它表示服务构建器可以编译h2o pojo s(。 java文件)和mojo s(在我的情况下从h2o flow下载为.zip(版本3.10.5.2),我一直以here所示的方式使用)。但是,做这样的事情:

enter image description here

给出了这个错误:

Problem accessing /makewar. Reason:

    Compilation of pojo failed exit value 1  warning: [options] bootstrap class path not set in conjunction with -source 1.6
error: Class names, 'drf_denials_v4.zip', are only accepted if annotation processing is explicitly requested
1 error
1 warning

那么如何在servicec builder中使用mojo文件呢?我是否需要使用"导出"来自h2o flow的模型文件而不是"已下载的" zip文件?我需要使用mojo而不是.java pojo的原因是我的模型太大而无法放入pojo可从h2o flow下载。

更新

尝试使用CLI命令:

$ curl -X POST --form mojo=@drf_denials_v4.zip --form jar=@h2o-genmodel.jar localhost:55000/makewar > drf_denials_v4.war
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  106M  100 53.6M  100 52.7M  6748k  6632k  0:00:08  0:00:08 --:--:--  229k
中。包含相关文件,然后使用命令:

prediction-service-builder git:(master)$ java -jar jetty-runner-9.3.9.M1.jar --port 55001 ~/Documents/h2o_production/mojos/drf_denials_v4/drf_denials_v4.war

给出输出:

2017-09-21 12:33:58.226:INFO::main: Logging initialized @232ms
2017-09-21 12:33:58.234:INFO:oejr.Runner:main: Runner
2017-09-21 12:33:58.558:INFO:oejs.Server:main: jetty-9.3.9.M1
2017-09-21 12:33:59.557:WARN:oeja.AnnotationConfiguration:main: ServletContainerInitializers: detected. Class hierarchy: empty
2017-09-21 12:34:00.068 -1000 [main] INFO ServletUtil - modelNames size 1
2017-09-21 12:34:01.285 -1000 [main] INFO ServletUtil - added model drf_denials_v4  new size 1
2017-09-21 12:34:01.290 -1000 [main] INFO ServletUtil - added 1 models
2017-09-21 12:34:01.291:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@4c75cab9{/,file:///tmp/jetty-0.0.0.0-55001-drf_denials_v4.war-_-any-39945022624149883.dir/webapp/,AVAILABLE}{file:///home/reedv/Documents/h2o_production/mojos/drf_denials_v4/drf_denials_v4.war}
2017-09-21 12:34:01.321:INFO:oejs.AbstractConnector:main: Started ServerConnector@176c9571{HTTP/1.1,[http/1.1]}{0.0.0.0:55001}
2017-09-21 12:34:01.322:INFO:oejs.Server:main: Started @3329ms

转到localhost:55001,并试图做出预测,我看到: enter image description here

请注意,带有标签的预测,但没有参数输入字段,我得到cli错误消息:

2017-09-21 12:35:11.270:WARN:oejs.ServletHandler:qtp1531448569-12: Error for /info
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3332)
    at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
    at java.lang.StringBuffer.append(StringBuffer.java:270)
    at java.io.StringWriter.write(StringWriter.java:101)
    at java.io.StringWriter.append(StringWriter.java:143)
    at java.io.StringWriter.append(StringWriter.java:41)
    at com.google.gson.stream.JsonWriter.value(JsonWriter.java:519)
    at com.google.gson.internal.bind.TypeAdapters$5.write(TypeAdapters.java:210)
    at com.google.gson.internal.bind.TypeAdapters$5.write(TypeAdapters.java:194)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
    at com.google.gson.internal.bind.ArrayTypeAdapter.write(ArrayTypeAdapter.java:93)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
    at com.google.gson.internal.bind.ArrayTypeAdapter.write(ArrayTypeAdapter.java:93)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:112)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:239)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:68)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:112)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:239)
    at com.google.gson.Gson.toJson(Gson.java:661)
    at com.google.gson.Gson.toJson(Gson.java:640)
    at com.google.gson.Gson.toJson(Gson.java:595)
    at com.google.gson.Gson.toJson(Gson.java:575)
    at InfoServlet.doGet(InfoServlet.java:59)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:837)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)

cli pojo example有效,但尝试使用我的mojo zip不会。

1 个答案:

答案 0 :(得分:1)

不幸的是,UI尚未针对mojo功能进行更新。但是,您可以使用命令行使用mojos构建war文件。

从命令行运行:

{{1}}

然后以正常方式运行war文件。

有关详细信息,请参阅:https://github.com/h2oai/steam/tree/master/prediction-service-builder