From d7c261ec40466a2af0fa12024f8aae1e98708172 Mon Sep 17 00:00:00 2001 From: Ryan Nett Date: Wed, 10 Jul 2019 14:40:17 -0700 Subject: [PATCH] added ability to run as test, and comments (#44) Signed-off-by: Ryan Nett --- .../imports/listeners/ImportModelDebugger.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/imports/listeners/ImportModelDebugger.java b/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/imports/listeners/ImportModelDebugger.java index f7b482483..b0906f75e 100644 --- a/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/imports/listeners/ImportModelDebugger.java +++ b/nd4j/nd4j-backends/nd4j-tests/src/test/java/org/nd4j/imports/listeners/ImportModelDebugger.java @@ -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 + * *
  * {@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);