@@ -0,0 +1,3356 @@
+package org.deeplearning4j.nn.modelimport.keras;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.net.URL;%0A%0Aimport lombok.extern.slf4j.Slf4j;%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.deeplearning4j.nn.graph.ComputationGraph;%0Aimport org.deeplearning4j.nn.modelimport.keras.exceptions.InvalidKerasConfigurationException;%0Aimport org.deeplearning4j.nn.modelimport.keras.exceptions.UnsupportedKerasConfigurationException;%0Aimport org.deeplearning4j.nn.modelimport.keras.layers.custom.KerasLRN;%0Aimport org.deeplearning4j.nn.modelimport.keras.layers.custom.KerasPoolHelper;%0Aimport org.deeplearning4j.nn.multilayer.MultiLayerNetwork;%0Aimport org.deeplearning4j.util.ModelSerializer;%0Aimport org.junit.Test;%0A%0A/**%0A * Test import of Keras models.%0A *%0A * @author Justin Long (crockpotveggies)%0A */%0A@Slf4j%0Apublic class KerasModelImportTest %7B%0A    @Test%0A    public void testH5WithoutTensorflowScope() throws Exception %7B%0A        MultiLayerNetwork model = loadModel(%22model.h5%22);%0A        System.out.println(model.params());%0A        assert (model != null);%0A    %7D%0A%0A    @Test%0A    public void testH5WithTensorflowScope() throws Exception %7B%0A        MultiLayerNetwork model = loadModel(%22model.h5.with.tensorflow.scope%22);%0A        System.out.println(model.params());%0A        assert (model != null);%0A    %7D%0A%0A    @Test%0A    public void testWeightAndJsonWithoutTensorflowScope() throws Exception %7B%0A        MultiLayerNetwork model = loadModel(%22model.json%22, %22model.weight%22);%0A        System.out.println(model.params());%0A        assert (model != null);%0A    %7D%0A%0A    @Test%0A    public void testWeightAndJsonWithTensorflowScope() throws Exception %7B%0A        MultiLayerNetwork model = loadModel(%22model.json.with.tensorflow.scope%22, %22model.weight.with.tensorflow.scope%22);%0A        System.out.println(model.params());%0A        assert (model != null);%0A    %7D%0A%0A    private MultiLayerNetwork loadModel(String modelJsonFilename, String modelWeightFilename) %7B%0A        ClassLoader classLoader = getClass().getClassLoader();%0A        File modelJsonFile = new File(classLoader.getResource(modelJsonFilename).getFile());%0A        File modelWeightFile = new File(classLoader.getResource(modelWeightFilename).getFile());%0A%0A        MultiLayerNetwork network = null;%0A        try %7B%0A            network = KerasModelImport.importKerasSequentialModelAndWeights(modelJsonFile.getAbsolutePath(),%0A                    modelWeightFile.getAbsolutePath());%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D catch (InvalidKerasConfigurationException e) %7B%0A            e.printStackTrace();%0A        %7D catch (UnsupportedKerasConfigurationException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        return network;%0A    %7D%0A%0A    private MultiLayerNetwork loadModel(String modelFilename) %7B%0A        ClassLoader classLoader = getClass().getClassLoader();%0A        File modelFile = new File(classLoader.getResource(modelFilename).getFile());%0A%0A        MultiLayerNetwork model = null;%0A        try %7B%0A            model = KerasModelImport.importKerasSequentialModelAndWeights(modelFile.getAbsolutePath());%0A        %7D catch (IOException e) %7B%0A            e.printStackTrace();%0A        %7D catch (InvalidKerasConfigurationException e) %7B%0A            e.printStackTrace();%0A        %7D catch (UnsupportedKerasConfigurationException e) %7B%0A            e.printStackTrace();%0A        %7D%0A%0A        return model;%0A    %7D%0A%7D%0A

add test