<p dir="auto"><em>Please make sure that this is a bug. As per our <a href="https://github.com/tensorflow/tensorflow/blob/master/ISSUES.md">GitHub Policy</a>, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template</em></p>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>
<p dir="auto">Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No</p>
</li>
<li>
<p dir="auto">OS Platform and Distribution (e.g., Linux Ubuntu 16.04):  Linux Ubuntu 16.04</p>
</li>
<li>
<p dir="auto">Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:</p>
</li>
<li>
<p dir="auto">TensorFlow installed from (source or binary): binary</p>
</li>
<li>
<p dir="auto">TensorFlow version (use command below): r1.13</p>
</li>
<li>
<p dir="auto">Python version: 3.6</p>
</li>
<li>
<p dir="auto">Bazel version (if compiling from source):</p>
</li>
<li>
<p dir="auto">GCC/Compiler version (if compiling from source):</p>
</li>
<li>
<p dir="auto">CUDA/cuDNN version:</p>
</li>
<li>
<p dir="auto">GPU model and memory:</p>
</li>
</ul>
<p dir="auto">You can collect some of this information using our environment capture<br>
<a href="https://github.com/tensorflow/tensorflow/tree/master/tools/tf_env_collect.sh">script</a><br>
You can also obtain the TensorFlow version with: 1. TF 1.0: <code class="notranslate">python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"</code> 2. TF 2.0: <code class="notranslate">python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"</code></p>
<p dir="auto"><strong>Describe the current behavior</strong></p>
<p dir="auto">I have created <code class="notranslate">.tflite</code> with single <code class="notranslate">ADD</code> op. It has two inputs and one output.<br>
When reading this <code class="notranslate">.tflite</code> with interpreter(e.g. <code class="notranslate">tensorflow.lite.python</code>)</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import sys

import numpy as np

from tensorflow.lite.python import interpreter as interpreter_wrapper

interpreter = interpreter_wrapper.Interpreter(model_path=sys.argv[1])
interpreter.allocate_tensors()

input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()

print(input_details)
print(output_details)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">sys</span>

<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-k">from</span> <span class="pl-s1">tensorflow</span>.<span class="pl-s1">lite</span>.<span class="pl-s1">python</span> <span class="pl-k">import</span> <span class="pl-s1">interpreter</span> <span class="pl-k">as</span> <span class="pl-s1">interpreter_wrapper</span>

<span class="pl-s1">interpreter</span> <span class="pl-c1">=</span> <span class="pl-s1">interpreter_wrapper</span>.<span class="pl-v">Interpreter</span>(<span class="pl-s1">model_path</span><span class="pl-c1">=</span><span class="pl-s1">sys</span>.<span class="pl-s1">argv</span>[<span class="pl-c1">1</span>])
<span class="pl-s1">interpreter</span>.<span class="pl-en">allocate_tensors</span>()

<span class="pl-s1">input_details</span> <span class="pl-c1">=</span> <span class="pl-s1">interpreter</span>.<span class="pl-en">get_input_details</span>()
<span class="pl-s1">output_details</span> <span class="pl-c1">=</span> <span class="pl-s1">interpreter</span>.<span class="pl-en">get_output_details</span>()

<span class="pl-en">print</span>(<span class="pl-s1">input_details</span>)
<span class="pl-en">print</span>(<span class="pl-s1">output_details</span>)</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[{'name': 'input0', 'index': 0, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}, {'name': 'input1', 'index': 1, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}]
[{'name': 'output0', 'index': 2, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}, {'name': 'output0', 'index': 2, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}]"><pre class="notranslate"><code class="notranslate">[{'name': 'input0', 'index': 0, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}, {'name': 'input1', 'index': 1, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}]
[{'name': 'output0', 'index': 2, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}, {'name': 'output0', 'index': 2, 'shape': array([2, 5], dtype=int32), 'dtype': &lt;class 'numpy.float32'&gt;, 'quantization': (0.0, 0)}]
</code></pre></div>
<p dir="auto">Code using  C++ interpreter also reports duplicated outputs(2 2), even though outout of ADD(builtin code 0) shows one output.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Interpreter has 3 tensors and 1 nodes
Inputs: 0 1
Outputs: 2 2

Tensor   0 input0               kTfLiteFloat32  kTfLiteArenaRw         40 bytes ( 0.0 MB)  2 5
Tensor   1 input1               kTfLiteFloat32  kTfLiteArenaRw         40 bytes ( 0.0 MB)  2 5
Tensor   2 output0              kTfLiteFloat32  kTfLiteArenaRw         40 bytes ( 0.0 MB)  2 5

Node   0 Operator Builtin Code   0
  Inputs: 0 1
  Outputs: 2"><pre class="notranslate"><code class="notranslate">Interpreter has 3 tensors and 1 nodes
Inputs: 0 1
Outputs: 2 2

Tensor   0 input0               kTfLiteFloat32  kTfLiteArenaRw         40 bytes ( 0.0 MB)  2 5
Tensor   1 input1               kTfLiteFloat32  kTfLiteArenaRw         40 bytes ( 0.0 MB)  2 5
Tensor   2 output0              kTfLiteFloat32  kTfLiteArenaRw         40 bytes ( 0.0 MB)  2 5

Node   0 Operator Builtin Code   0
  Inputs: 0 1
  Outputs: 2
</code></pre></div>
<p dir="auto"><strong>Describe the expected behavior</strong></p>
<p dir="auto"><code class="notranslate">get_output_details()</code> returns unique list of outputs.</p>
<p dir="auto"><strong>Code to reproduce the issue</strong></p>
<p dir="auto">Use attached <code class="notranslate">.tflite</code> file to reproduce the issue.</p>
<p dir="auto"><a href="https://github.com/tensorflow/tensorflow/files/3124805/add.tflite.zip">add.tflite.zip</a></p>
<p dir="auto">Installed nightly build using</p>
<blockquote>
<p dir="auto">pip3 install tensorflow-1.1.0rc0-cp35-cp35m-win_amd64.whl<br>
on Windows 7 Professional x64.  Simple run gives warning that the libs were not compiled to use SSE, SSE2, SSE3, SSE4.1, SSE4.2 and AVX instructions even though available.</p>
</blockquote>
<p dir="auto">c:\python<br>
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32<br>
Type "help", "copyright", "credits" or "license" for more information.</p>
<blockquote>
<blockquote>
<blockquote>
<p dir="auto">import tensorflow as tf<br>
print( tf.<strong>version</strong>)<br>
1.1.0-rc0<br>
hello = tf.constant('Hello, TensorFlow!')<br>
sess = tf.Session()<br>
2017-03-30 15:20:06.126686: W c:\tf_jenkins\home\workspace\nightly-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_<br>
tions, but these are available on your machine and could speed up CPU computations.<br>
&lt;<br>
print(sess.run(hello))<br>
b'Hello, TensorFlow!'</p>
</blockquote>
</blockquote>
</blockquote>