added ability to run as test, and comments (#44)

Signed-off-by: Ryan Nett <rnett@skymind.io>
master
Ryan Nett 2019-07-10 14:40:17 -07:00 committed by AlexDBlack
parent 5708fc087a
commit d7c261ec40
1 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,8 @@
package org.nd4j.imports.listeners;
import org.apache.commons.io.FileUtils;
import org.junit.Ignore;
import org.junit.Test;
import org.nd4j.autodiff.samediff.SameDiff;
import org.nd4j.imports.graphmapper.tf.TFGraphMapper;
import org.nd4j.linalg.api.ndarray.INDArray;
@ -15,9 +17,12 @@ import java.util.Map;
/**
* Small utility for debugging Tensorflow import.
*
* If you get a java.lang.NoSuchMethodError: java.nio.ByteBuffer.rewind() run with Java 9 or higher
*
* Quick and dirty Python code to generate test data: (this is slow and could no doubt be improved)
*
* Also available in TFOpsTests via ZooEvaluation#write_intermediates
*
* <pre>
* {@code
* import os
@ -71,10 +76,16 @@ import java.util.Map;
*/
public class ImportModelDebugger {
@Test
@Ignore
public void doTest(){
main(new String[0]);
}
public static void main(String[] args) {
File modelFile = new File("C:\\Temp\\TF_Graphs\\faster_rcnn_resnet101_coco_2018_01_28\\frozen_inference_graph.pb");
File rootDir = new File("C:\\Temp\\TF_Test");
File modelFile = new File("C:\\Temp\\TF_Graphs\\cifar10_gan_85\\tf_model.pb");
File rootDir = new File("C:\\Temp\\TF_Graphs\\cifar10_gan_85");
SameDiff sd = TFGraphMapper.getInstance().importGraph(modelFile);