Created
January 12, 2018 16:43
-
-
Save tomthetrainer/cf7127ae695a440bd97bea29d952de09 to your computer and use it in GitHub Desktop.
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
package skymind.dsx; | |
/** | |
* Created by tomhanlon on 12/29/17. | |
*/ | |
import org.apache.log4j.BasicConfigurator; | |
import org.deeplearning4j.nn.modelimport.keras.KerasModelImport; | |
import org.deeplearning4j.nn.multilayer.MultiLayerNetwork; | |
public class Keras2ModelImport { | |
public static void main(String[] args) throws Exception{ | |
BasicConfigurator.configure(); | |
String kerasModelfromKerasExport = "/tmp/my_model.h5"; | |
MultiLayerNetwork model = KerasModelImport.importKerasSequentialModelAndWeights(kerasModelfromKerasExport); | |
System.out.println("Model Configuration"); | |
String modelconfig = model.conf().toJson(); | |
System.out.println(modelconfig); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment