0

打电话时

curl -XPUT -H "content-type: application/json" -d 
'{"path":"/models/testALS.zip"}' http://localhost:65327/model

得到错误。

我使用 spark-mllib 训练了一个 als 模型,并在调用它时将模型保存为 testALS.zip

curl -XPUT -H "content-type: application/json" -d 
'{"path":"/models/testALS.zip"}' http://localhost:65327/model

有错误;错误消息粘贴在下面。

[错误] [05/10/2019 04:10:57.815] [MleapServing-akka.actor.default-dispatcher-3] [MleapResource] 请求 java.util.NoSuchElementException 错误:找不到密钥:scala.collection 中的 als。 MapLike$class.default(MapLike.scala:228) at scala.collection.AbstractMap.default(Map.scala:59) at scala.collection.MapLike$class.apply(MapLike.scala:141) at scala.collection.AbstractMap .apply(Map.scala:59) at ml.combust.bundle.BundleRegistry.model(BundleRegistry.scala:93) at ml.combust.bundle.serializer.ModelSerializer$$anonfun$readWithModel$2.apply(ModelSerializer.scala:105 )

4

1 回答 1

0

我相信您使用的端点是用于更新现有的加载模型。我不确定您使用的是哪个版本的 MLeap,所以这里是我将如何加载模型:

  1. 我建议至少使用 0.13.1 版本。
  2. 我推荐使用spring boot server,它在8080端口
  3. 然后,您需要使用以下方法加载模型POST
curl -X POST http://localhost:8080/models \
  -H 'Content-Type: application/json' \
  -d '{"modelName":"airbnb", "uri":"file:/models/airbnb.model.lr.zip", "config": {"memoryTimeout": 10000, "diskTimeout": 10000}, "force": false}'
于 2019-05-10T20:29:02.610 回答