title: Tensorflow lite example with custom model - "input_product_scale < output_scale was not true"
body: <p><strong>How to reproduce:</strong><br>
  retrain a mobilenet with command:  </p>
  
  <pre><code>python tensorflow/tensorflow/examples/image_retraining/retrain.py 
  —image_dir (data-pwd) 
  —learning_rate=0.001 —testing_percentage=20 
  —validation_percentage=20 —train_batch_size=32 
  —validation_batch_size=-1 —flip_left_right True 
  —random_scale=30 —random_brightness=30 
  —eval_step_interval=100 —how_many_training_steps=200 
  —architecture mobilenet_1.0_224_quantized —default_ranges_min=0 
  —default_ranges_max=6 —std_values=224 
  —mean_values=224  
  </code></pre>
  
  <p><code>mean values</code> and <code>std_values</code> don't really make a difference - tried different combinations.<br>
  then I converted the resulting .pb file like so:  </p>
  
  <pre><code>bazel-bin/tensorflow/contrib/lite/toco/toco --input_file=(path)/output_graph.pb --input_format=TENSORFLOW_GRAPHDEF 
  --output_format=TFLITE 
  --output_file=./mobilenet_quantized_224.tflite --inference_type=QUANTIZED_UINT8 
  --input_type=QUANTIZED_UINT8 --input_array=Placeholder --output_array=final_result 
  --input_shape=1,224,224,3
  --output_array=final_result --input_shape=1,224,224,3
  </code></pre>
  
  <p>Then I've replaced in both stock apps: iOS simple and Android camera example app the tflite model with the generated one. This leads both to the same error:  </p>
  
  <p><strong>Error:</strong><br>
  Android:  </p>
  
  <pre><code>Can not allocate memory for the given inputs: 
  tensorflow/contrib/lite/kernels/kernel_util.cc:34 
  input_product_scale &lt; output_scale was not true.
  </code></pre>
  
  <p>iOS:  </p>
  
  <pre><code>/Library/Developer/CoreSimulator/Devices/10888914-22EB-4CA7-B019-F95D5A8A6F5C/data/Containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
  
  nnapi error: unable to open library libneuralnetworks.so
  Loaded model resolved reportertensorflow/contrib/lite/kernels
  /kernel_util.cc:34 input_product_scale &lt; output_scale was not 
  true.Failed to allocate tensors!(lldb) 
  </code></pre>
  
  <p><strong>Question:</strong><br>
  How to solve... error? :)</p>
  
  <p><strong>Edit as I'm adding a bounty:</strong>
  The goal would be to get an explanation on how to retrain a model and get it running with tensorflow lite. I'm aware this is very new, but I'm running left and right into errors with the docs.</p>