title: Tensorflow : How to use speech recognition model trained in python in java
body: <p>I have a tensorflow model trained in python by following <a href="https://www.tensorflow.org/tutorials/sequences/audio_recognition" rel="nofollow noreferrer">this article.</a> After training I have generated the <strong>frozen graph.</strong> Now I need to use this graph and generate recognition on a <strong>JAVA</strong> based application. 
  For this I was looking at the following <a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/java/src/main/java/org/tensorflow/examples/LabelImage.java" rel="nofollow noreferrer">example</a> . However I failed to understand is to how to collect my output. I know that I need to provide 3 inputs to the graph.</p>
  
  <p>From the example given on the official tutorial I have read the code that is based on python.</p>
  
  <pre><code>def run_graph(wav_data, labels, input_layer_name, output_layer_name,
                num_top_predictions):
    """Runs the audio data through the graph and prints predictions."""
    with tf.Session() as sess:
      # Feed the audio data as input to the graph.
      #   predictions  will contain a two-dimensional array, where one
      #   dimension represents the input image count, and the other has
      #   predictions per class
      softmax_tensor = sess.graph.get_tensor_by_name(output_layer_name)
      predictions, = sess.run(softmax_tensor, {input_layer_name: wav_data})
  
      # Sort to show labels in order of confidence
      top_k = predictions.argsort()[-num_top_predictions:][::-1]
      for node_id in top_k:
        human_string = labels[node_id]
        score = predictions[node_id]
        print('%s (score = %.5f)' % (human_string, score))
  
      return 0
  </code></pre>
  
  <p>Can someone help me to understand the tensorflow java api?</p>