Created
February 12, 2020 07:45
-
-
Save choowilson/7504ec08b83b5bf0f2304c57395f4a0a to your computer and use it in GitHub Desktop.
method to import keras model in dl4j
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.deeplearning4j.nn.graph.ComputationGraph; | |
import org.deeplearning4j.nn.modelimport.keras.KerasModelImport; | |
import org.deeplearning4j.nn.modelimport.keras.exceptions.InvalidKerasConfigurationException; | |
import org.deeplearning4j.nn.modelimport.keras.exceptions.UnsupportedKerasConfigurationException; | |
public void initKeras() throws InvalidKerasConfigurationException, IOException, UnsupportedKerasConfigurationException { | |
ComputationGraph model = KerasModelImport.importKerasModelAndWeights("model.h5"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment