November 2019
Intermediate to advanced
304 pages
8h 40m
English
In step 1, we used KerasModelImport to load the external Keras model from disk. If the model was saved separately by calling model.to_json() and model.save_weights() (in Keras), then we need to use the following variant:
String modelJsonFileLocation = new ClassPathResource("kerasModel.json").getFile().getPath(); String modelWeightsFileLocation = new ClassPathResource("kerasModelWeights.h5").getFile().getPath(); MultiLayerNetwork model = KerasModelImport.importKerasSequentialModelAndWeights(modelJsonFileLocation, modelWeightsFileLocation, enforceTrainConfig);
Note the following: