question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mleap-server, model loading error

See original GitHub issue

I am following the example here with my own dataset.

It works all the way till the serializing/deserializing with no problems.

However, when I am loading the model on a running mleap-server as explained here , it fails with the error.

[ERROR] [04/20/2017 12:22:19.020] [MleapServing-akka.actor.default-dispatcher-13] [MleapResource] error with request
java.nio.file.NoSuchFileException: bundle.json
        at com.sun.nio.zipfs.ZipFileSystem.newInputStream(ZipFileSystem.java:544)
        at com.sun.nio.zipfs.ZipPath.newInputStream(ZipPath.java:645)
        at com.sun.nio.zipfs.ZipFileSystemProvider.newInputStream(ZipFileSystemProvider.java:278)
        at java.nio.file.Files.newInputStream(Files.java:152)
        at ml.combust.bundle.BundleFile$$anonfun$readInfo$1.apply(BundleFile.scala:60)
        at ml.combust.bundle.BundleFile$$anonfun$readInfo$1.apply(BundleFile.scala:60)
        at resource.DefaultManagedResource.open(AbstractManagedResource.scala:110)
        at resource.AbstractManagedResource.acquireFor(AbstractManagedResource.scala:87)
        at resource.ManagedResourceOperations$class.apply(ManagedResourceOperations.scala:26)
        at resource.AbstractManagedResource.apply(AbstractManagedResource.scala:50)
        at resource.DeferredExtractableManagedResource$$anonfun$tried$1.apply(AbstractManagedResource.scala:33)
        at scala.util.Try$.apply(Try.scala:192)
        at resource.DeferredExtractableManagedResource.tried(AbstractManagedResource.scala:33)
        at ml.combust.bundle.BundleFile.readInfo(BundleFile.scala:63)
        at ml.combust.bundle.serializer.BundleSerializer.read(BundleSerializer.scala:49)
        at ml.combust.bundle.BundleFile.load(BundleFile.scala:87)
        at ml.combust.mleap.runtime.MleapSupport$MleapBundleFileOps.loadMleapBundle(MleapSupport.scala:18)
        at ml.combust.mleap.serving.MleapService$$anonfun$loadModel$2$$anonfun$apply$2.apply(MleapService.scala:28)
        at ml.combust.mleap.serving.MleapService$$anonfun$loadModel$2$$anonfun$apply$2.apply(MleapService.scala:27)
        at resource.AbstractManagedResource$$anonfun$5.apply(AbstractManagedResource.scala:88)
        at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:125)
        at scala.util.control.Exception$Catch$$anonfun$either$1.apply(Exception.scala:125)
        at scala.util.control.Exception$Catch.apply(Exception.scala:103)
        at scala.util.control.Exception$Catch.either(Exception.scala:125)
        at resource.AbstractManagedResource.acquireFor(AbstractManagedResource.scala:88)
        at resource.ManagedResourceOperations$class.apply(ManagedResourceOperations.scala:26)
        at resource.AbstractManagedResource.apply(AbstractManagedResource.scala:50)
        at resource.DeferredExtractableManagedResource$$anonfun$tried$1.apply(AbstractManagedResource.scala:33)
        at scala.util.Try$.apply(Try.scala:192)
        at resource.DeferredExtractableManagedResource.tried(AbstractManagedResource.scala:33)
        at ml.combust.mleap.serving.MleapService$$anonfun$loadModel$2.apply(MleapService.scala:29)
        at ml.combust.mleap.serving.MleapService$$anonfun$loadModel$2.apply(MleapService.scala:29)
        at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
        at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:39)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(AbstractDispatcher.scala:415)
        at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
        at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
        at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
        at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

[ERROR] [04/20/2017 12:22:19.021] [MleapServing-akka.actor.default-dispatcher-13] [akka.actor.ActorSystemImpl(MleapServing)] Error during processing of request: 'bundle.json'. Completing with 500 Internal Server Error response.

The file bundle.json exists in the zipfile alongside the root folder. The airbnb Random Forest model example fails as well (loading it with curl -X PUT -H "content-type: application/json" -d '{"path":"airbnb.model.rf-0.6.0-SNAPSHOT.zip"}' http://localhost:65327/model with the same error.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
kidtronnixcommented, May 31, 2017

Hi,

Thanks for looking at this. In the end I did get my code working, this is what I ended up using in the end.

import ml.combust.bundle.BundleFile
import ml.combust.bundle.serializer.SerializationFormat
import org.apache.spark.ml.feature.{StringIndexerModel, VectorAssembler}
import org.apache.spark.ml.mleap.SparkUtil
import ml.combust.mleap.spark.SparkSupport._
import resource._

// Create a sample pipeline that we will serialize
// And then deserialize using various formats
val stringIndexer = new StringIndexerModel(labels = Array("Hello, MLeap!", "Another row")).
  setInputCol("a_string").
  setOutputCol("a_string_index")
val featureAssembler = new VectorAssembler().setInputCols(Array("a_string_index")).
  setOutputCol("features")

// create pipeline that will transform data
val pipeline = SparkUtil.createPipelineModel(Array(stringIndexer, featureAssembler))

// write to tmp storage
for(bundle <- managed(BundleFile("jar:file:/tmp/simple.json.zip"))) {
  pipeline.writeBundle.format(SerializationFormat.Json).save(bundle)
}
0reactions
hollinwilkinscommented, Mar 16, 2018

Closing this issue. Executable scripts can be found in the mleap-service submodule or on dockerhub in our prebuilt docker images.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Errors — MapServer 8.0.0 documentation
The message tells you that MapServer cannot find map file or has problems with the map file. Verify that you have specified the...
Read more >
mapserver not displaying anything - GIS Stack Exchange
Mapserver displays the layers in sequence and, thus, if a layer of higher importance is below a raster image, you can be spinning...
Read more >
Layer | API Reference | ArcGIS Maps SDK for JavaScript 4.25
Indicates whether the layer's resources have loaded. more details, Layer. loadError, Error. The Error object returned if an error occurred while loading. more ......
Read more >
map_server does not load map - ROS Answers
Our problem comes when we map the entire floor of the building, ... fov 240 samples 680 ) # generic model properties color...
Read more >
Problem: Querying a map service fails with a server log error
The issue is caused by insufficient machine process core and instances to run a query on large map services. By default, ArcGIS Server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found