问题
I'm using h2o version 3.0.0.22 in R and I'm trying to save my model. But I can't seem to figure out what format is expected. I've tried all sorts of variations but getting all sorts of different exceptions.
h2o.saveModel(model, dir="c:/temp", name= "my.model")
ERROR: Unexpected HTTP Status code: 400 Bad Request (url = http://127.0.0.1:54321/3/Models.bin/DeepLearningModel__8412f3abf1699b5593a55c6861c8468d?dir=c%3A%2Ftemp%2Fmy.model&force=0)
java.lang.IllegalArgumentException
[1] "water.persist.PersistManager.getPersistForURI(PersistManager.java:407)"
[2] "water.serial.ObjectTreeBinarySerializer.save(ObjectTreeBinarySerializer.java:57)"
[3] "water.api.ModelsHandler.exportModel(ModelsHandler.java:206)"
[4] "sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)"
[5] "sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)"
[6] "java.lang.reflect.Method.invoke(Unknown Source)"
[7] "water.api.Handler.handle(Handler.java:56)"
[8] "water.api.RequestServer.handle(RequestServer.java:677)"
[9] "water.api.RequestServer.serve(RequestServer.java:614)"
[10] "water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438)"
[11] "java.lang.Thread.run(Unknown Source)"
Error in .h2o.doSafeREST(conn = conn, h2oRestApiVersion = h2oRestApiVersion, :
Cannot find persist manager for scheme c
How can I save my model on my Windows 8 machine?
UPDATE: This command here seems to create a folder & file:
h2o.saveModel(model, filename="file:///C:/temp/model")
This created a file: C:/temp/DeepLearningModel__8412f3ab21699b5593aa5c6861c8468d.bin
But then throws a different error:
ERROR: Unexpected HTTP Status code: 400 Bad Request (url = http://127.0.0.1:54321/3/Models.bin/DeepLearningModel__8412f3abf1699b5593a55c6861c8468d?dir=file%3A%2F%2F%2FC%3A%2Ftemp%2Fmodel&force=0)
java.lang.IllegalArgumentException
[1] "java.net.URI.create(Unknown Source)"
[2] "water.serial.ObjectTreeBinarySerializer.save(ObjectTreeBinarySerializer.java:70)"
[3] "water.api.ModelsHandler.exportModel(ModelsHandler.java:206)"
[4] "sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)"
[5] "sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)"
[6] "java.lang.reflect.Method.invoke(Unknown Source)"
[7] "water.api.Handler.handle(Handler.java:56)"
[8] "water.api.RequestServer.handle(RequestServer.java:677)"
[9] "water.api.RequestServer.serve(RequestServer.java:614)"
[10] "water.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:438)"
[11] "java.lang.Thread.run(Unknown Source)"
Error in .h2o.doSafeREST(conn = conn, h2oRestApiVersion = h2oRestApiVersion, :
Malformed escape pair at index 165: file:///C:/temp/model/modelmetrics_DeepLearningModel__8412f3abf1699b5593a55c6861c8468d@-1218026610891888320_on_TrainingData.hex_1_part0.temporary.sample.9.91%@1615017098181529186.bin
回答1:
H2O JIRA contains issue PUBDEV-1566 which is referencing your problem.
You can try to use the latest H2O - 3.0.0.26 which contains fix for the issue. You can find it here.
来源:https://stackoverflow.com/questions/31196199/h2o-savemodel-throwing-exception-with-directory-on-windows-8