I want to import a tensorflow model.h5 file. The model will take in an image and predict whether its a real or fake face. But the newly imported DL4J model is not as accurate as the original tensorflow model. Is there any things I can fix about it ?
NativeImageLoader loader = new NativeImageLoader(height, width, 3);
INDArray image = loader.asMatrix(file, false);//Normalization
DataNormalization scalar = new ImagePreProcessingScaler(0, 1);
scalar.transform(image);//Read in model file
File resourcesDirectory = new File(“src/main/resources”);
final String SIMPLE_MLP = new File(resourcesDirectory.getAbsolutePath(), “model.h5”).getAbsolutePath();//Predict Result
ComputationGraph model = KerasModelImport.importKerasModelAndWeights(SIMPLE_MLP, true);
INDArray results = model.outputSingle(image);