0

I am following Tensorflow for poet instruction for retrain model. I have successfully create retrained_graph.pb and retrained_labels.txt. While I use imagenet_comp_graph_label_strings.txt and tensorflow_inception_graph.pb then application run without any error. But use my created file then I get error that:

Caused by: java.lang.UnsupportedOperationException: Op BatchNormWithGlobalNormalization is not available in GraphDef version 21. It has been removed in version 9. Use tf.nn.batch_normalization(). at org.tensorflow.Graph.importGraphDef(Native Method) at org.tensorflow.Graph.importGraphDef(Graph.java:118) at org.tensorflow.Graph.importGraphDef(Graph.java:102) at org.tensorflow.contrib.android.TensorFlowInferenceInterface.load(TensorFlowInferenceInterface.java:402) at org.tensorflow.contrib.android.TensorFlowInferenceInterface.initializeTensorFlow(TensorFlowInferenceInterface.java:91) at org.tensorflow.demo.TensorFlowImageClass

I Also try to retrain model from scratch followed TensorFlow guides but I get same error. I also try to strip graph and change in ClassifierActivity. But still I get same error.

kinjal patel
  • 585
  • 2
  • 4
  • 12

1 Answers1

0

It looks like you're using two incompatible versions of TensorFlow, one to train the first model and a different older one is getting called from java.

How are you using the created files? Can you rebuild the programs which do that to use newer versions of tf?

Alexandre Passos
  • 5,186
  • 1
  • 14
  • 19
  • I am using latest version of tenserflow for run application.For train model I use link that post in question.I put created file in asset folder and add libtensorflow_demo.so in libs folder.In this way I able to run tensorflow model but not by my created model. – kinjal patel Mar 17 '17 at 11:53
  • The version on the android runtime is definitely older than 1.0, because of the error message. – Alexandre Passos Mar 20 '17 at 20:23