protected Model loadModel(File inputModelFile) {
Model model = factory.constructModel();
try {
System.out.println("Reading model from " + inputModelFile);
InputStream inputModel = new FileInputStream(inputModelFile);
model.load(inputModel);
inputModel.close();
} catch (FileNotFoundException e) {
System.err.println("Model file " + inputModelFile + " not found.");
System.exit(1);
} catch (InvalidObjectException e) {