Skip to content

Instantly share code, notes, and snippets.

@mmalohlava
Created October 6, 2015 18:00
Show Gist options
  • Select an option

  • Save mmalohlava/d3744cfe0d486ad44c85 to your computer and use it in GitHub Desktop.

Select an option

Save mmalohlava/d3744cfe0d486ad44c85 to your computer and use it in GitHub Desktop.
Load model into DKV
public ModelsV3 importModel(int version, ModelImportV3 mimport) {
ModelsV3 s = (ModelsV3) Schema.newInstance(ModelsV3.class);
try {
List<Key> importedKeys = new ObjectTreeBinarySerializer().load(FileUtils.getURI(mimport.dir));
Model model = (Model) importedKeys.get(0).get();
s.models = new ModelSchema[1];
s.models[0] = (ModelSchema) Schema.schema(version, model).fillFromImpl(model);
} catch (IOException e) {
throw new H2OIllegalArgumentException("dir", "importModel", e);
}
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment