Deserializing fail
I followed spark guide link and serialized my pipeline into directory successfully in my toree notebook.
for(bundle <- managed(BundleFile("file:/tmp/mleap-examples/model-dir"))) {
mleap_pipeline.writeBundle.format(SerializationFormat.Json).save(bundle)
}
But I can't deserialize my pipeline from directory.
val dirBundle = (for(bundle <- managed(BundleFile("file:/tmp/mleap-examples/model-dir"))) yield {
bundle.loadSparkBundle().get
}).opt.get
Logs in notebook
Name: Unknown
Message: Unable to retrieve error!
StackTrace:
Logs in terminal
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:347)
at scala.None$.get(Option.scala:345)
... 48 elided
It seems the None object has been retrieved. But I've checked the directory is filled with many nodes.
oneHot_fe89d6d86262.node/ stdScal_7520fc9c8fa1.node/ vecAssembler_72646a6ac7e5.node/
rfc_abe11d71d09c.node/ strIdx_a4314dc62125.node/ w2v_fb08ff5fbe06.node/
What happened? I'm using v0.6.0.
@LTzycLT Hey, do you mind posting the directory structure for your model here, including all model.json/node.json files? Often this issue is caused because you have a OneHotEncoder in your pipeline and don't pass a DataFrame when serializing your pipeline. See this issue for more information:
https://github.com/combust/mleap/issues/135
Another tip is to make sure to unwrap any Try objects that are returned when serializing. This will make sure you don't have any serialization errors and can oftentime produce useful error messages.
@LTzycLT had the same error. For what is worth, only way I made the deserializing work is by using this code:
val sbc = SparkBundleContext().withDataset(pipeline.transform(dataset))
for(bf <- managed(BundleFile("jar:file:/tmp/test.zip"))) {
pipeline.writeBundle.save(bf)(sbc).get
}
Same error for me. I am deserializing from a zip file.
val model = (for(bundle <- managed(BundleFile(model_name))) yield {
bundle.loadMleapBundle().get
}).opt.get.root
And this code actually work in my Mac but not in my Linux environment.
@EvanzzzZ @manugarri Can you share the bundle file with us, which version of MLeap, and the Linux environment details with us?
You can send the bundle file to mikhail at combust.ml and hollin at combust.ml
Closing this for now until samples can be provided.
Do you have solved the problem?I meet the same error.
I'm getting a similar error, and when I call .tried on the ExtractableManagedResource[Bundle[Transformer]] I get:
Failure(java.util.NoSuchElementException: key not found: num_classes)
This explains why the Option is None, but I haven't been able to get to the bottom of what's going wrong yet.