0

when calling

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

get error.

I use spark-mllib trained an als model and save the model as testALS.zip when calling this

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

has error; the error message is pasted below.

[ERROR] [05/10/2019 04:10:57.815] [MleapServing-akka.actor.default-dispatcher-3] [MleapResource] error with request java.util.NoSuchElementException: key not found: als at scala.collection.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)

barbsan
  • 3,418
  • 11
  • 21
  • 28
  • 1
    Please add your question edits in your question instead of posting them in the comments. – T A May 10 '19 at 07:21

1 Answers1

0

I believe the endpoint you are using is for updating an existing, loaded model. I'm not sure which version of MLeap you are using, so here is how I would load a model:

  1. I recommend using at least version 0.13.1.
  2. I recommend using the spring boot server, which is on port 8080
  3. Then, you need to load a model using 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}'
ordonezalex
  • 2,645
  • 1
  • 20
  • 33