title: TensorFlow lite: High loss in accuracy after converting model to tflite
body: <p>I have been trying TFLite to increase detection speed on Android but strangely my .tflite model now almost only detects 1 category.</p>
  
  <p>I have done testing on the .pb model that I got after retraining a mobilenet and the results are good but for some reason, when I convert it to .tflite the detection is way off...</p>
  
  <p>For the retraining I used the retrain.py file from <a href="https://codelabs.developers.google.com/codelabs/tensorflow-for-poets-2-tflite/index.html?index=..%2F..%2Findex#0" rel="nofollow noreferrer">Tensorflow for poets 2</a></p>
  
  <p>I am using the following commands to retrain, optimize for inference and convert the model to tflite:</p>
  
  <pre><code>python retrain.py \
  --image_dir ~/tf_files/tw/ \
  --tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/feature_vector/1 \
  --output_graph ~/new_training_dir/retrainedGraph.pb \
  -–saved_model_dir ~/new_training_dir/model/ \
  --how_many_training_steps 500 
  
  sudo toco \
  --input_file=retrainedGraph.pb \
  --output_file=optimized_retrainedGraph.pb \
  --input_format=TENSORFLOW_GRAPHDEF \
  --output_format=TENSORFLOW_GRAPHDEF \
  --input_shape=1,224,224,3 \
  --input_array=Placeholder \
  --output_array=final_result \
  
  sudo toco \
  --input_file=optimized_retrainedGraph.pb \
  --input_format=TENSORFLOW_GRAPHDEF \
  --output_format=TFLITE \
  --output_file=retrainedGraph.tflite \
  --inference_type=FLOAT \
  --inference_input_type=FLOAT \
  --input_arrays=Placeholder \
  --output_array=final_result \
  --input_shapes=1,224,224,3
  </code></pre>
  
  <p>Am I doing anything wrong here? Where could the loss in accuracy come from?</p>