H2o with predict_json: "Error: Could not find or load main class water.util.H2OPredictor"?

H2o with predict_json: "Error: Could not find or load main class water.util.H2OPredictor"?

我尝试在 R 中使用 H2o predict_json,

h2o.predict_json(modelpath, jsondata)

并收到错误消息:

Error: Could not find or load main class water.util.H2OPredictor

我正在使用 h2o_3.20.0.8。

我从 H2o 搜索了文档,但没有帮助。

> h2o.predict_json(modelpath, jsondata)
$error
[1] "Error: Could not find or load main class water.util.H2OPredictor"

Warning message:
In system2(java, args, stdout = TRUE, stderr = TRUE) :
  running command ''java'  -Xmx4g -cp .:/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mylib/Models/h2o-genmodel.jar:/Library/Frameworks/R.framework/Versions/3.5/Resources/library/mylib/Models:genmodel.jar:/ water.util.H2OPredictor  /Library/Frameworks/R.framework/Versions/3.5/Resources/library/mylib/Models/mymodel.zip '[{"da1":252,"da2":22,"da3":62,"da4":63,"da5":84.83}]' 2>&1' had status 1

您似乎丢失了 h2o-genmodel.jar 文件 - 这就是错误消息 Could not find or load main class water.util.H2OPredictor 所指示的。您可能想提供所有参数以确认您拥有一切:

h2o.predict_json(model, json, genmodelpath, labels, classpath, javaoptions)

文档here