title: tensorflow lite: convert error for the quantized graphdef
body: <p>I folllowed the tutorial (<a href="https://www.tensorflow.org/performance/quantization" rel="nofollow noreferrer">https://www.tensorflow.org/performance/quantization</a>) to generate the quantized graphdef file:</p>
  
  <pre><code>curl -L "https://storage.googleapis.com/download.tensorflow.org/models/inception_v3_2016_08_28_frozen.pb.tar.gz" | tar -C tensorflow/examples/label_image/data -xz
  bazel build tensorflow/tools/graph_transforms:transform_graph
  bazel-bin/tensorflow/tools/graph_transforms/transform_graph \
    --in_graph=tensorflow/examples/label_image/data/inception_v3_2016_08_28_frozen.pb \
    --out_graph=/tmp/inception_v3_quantized_graph.pb \
    --inputs=input \
    --outputs=InceptionV3/Predictions/Reshape_1 \
    --transforms='add_default_attributes strip_unused_nodes(type=float, shape="1,299,299,3")
  remove_nodes(op=Identity, op=CheckNumerics) fold_constants(ignore_errors=true)
  fold_batch_norms fold_old_batch_norms quantize_weights quantize_nodes
  strip_unused_nodes sort_by_execution_order'
  </code></pre>
  
  <p>Then convert the quantized graphdef to tflite file:</p>
  
  <pre><code>    bazel-bin/tensorflow/contrib/lite/toco/toco \
    --input_file=/tmp/inception_v3_quantized_graph.pb\
    --output_file=/tmp/inception_v3_quantized_graph.lite \
    --input_format=TENSORFLOW_GRAPHDEF \
    --output_format=TFLITE \
    --inference_type=QUANTIZED_UINT8 --input_type=QUANTIZED_UINT8\
    --input_shape=1,299,299,3 \
    --input_array=input \
    --output_array=InceptionV3/Predictions/Reshape_1 \
    --mean_value=128 \
    --std_value=127
  </code></pre>
  
  <p>It failed with the error:</p>
  
  <pre><code>2017-11-23 12:36:40.637143: F tensorflow/contrib/lite/toco/tooling_util.cc:549] Check failed: model.arrays.count(input_array.name()) Input array not found: input
  Aborted (core dumped)
  </code></pre>
  
  <p>Run the summarize_graph tool</p>
  
  <pre><code>bazel-bin/tensorflow/tools/graph_transforms/summarize_graph \
    --in_graph=/tmp/inception_v3_quantized_graph.pb
  </code></pre>
  
  <p>The input node exists.</p>
  
  <pre><code>Found 1 possible inputs: (name=input, type=float(1), shape=[1,299,299,3])
  No variables spotted.
  Found 1 possible outputs: (name=InceptionV3/Predictions/Reshape_1, 
  op=Dequantize)
  Found 23824934 (23.82M) const parameters, 0 (0) variable parameters, and 268 
  control_edges
  Op types used: 673 Const, 214 Requantize, 214 RequantizationRange, 134 Reshape, 134 Max, 134 Min, 134 QuantizeV2, 95 QuantizedConv2D, 94 QuantizedRelu, 94 QuantizedAdd, 49 Dequantize, 24 QuantizedMul, 15 ConcatV2, 10 QuantizedAvgPool, 4 QuantizedMaxPool, 2 QuantizedReshape, 1 QuantizedBiasAdd, 1 Placeholder, 1 Softmax, 1 Squeeze
  </code></pre>
  
  <p>Did I miss anything? What is the right way to convert the quantized graphdef file into tflite file?</p>
  
  <p>Thanks!</p>