tensorflow / models

Models and examples built with TensorFlow
Other
77.02k stars 45.78k forks source link

MobileNet SSD V2 converted tflite output #8184

Closed 9friday closed 2 years ago

9friday commented 4 years ago

System information

Describe the problem

I am working on object detection application on android using the TensorflowLite C++API. When I convert ssd_mobilenet_v2_coco_2018_03_29 model to tflite, output of converted tflite model differs from output of originally provided .pb file on the same test images.

Converting the .pb file to .tflite

Terminal Command(I used this link as example.):

python3 object_detection/export_tflite_ssd_graph.py --pipeline_config_path=/content/ssd_mobilenet_v2_coco_2018_03_29/pipeline.config --trained_checkpoint_prefix=/content/ssd_mobilenet_v2_coco_2018_03_29/model.ckpt --output_directory=/tmp/tflite_graph --add_postprocessing_op=true

The above command threw an error:

google.protobuf.text_format.ParseError: 109:7 : Message type "object_detection.protos.SsdFeatureExtractor" has no field named "batch_norm_trainable"

The error was resolved after following the steps suggested here.

But, the detection output of the converted tflite model differs from that of the originaly provided .pb file.

Output Images:

Using .pb (and .pbtxt) files: pb_output_image2 pb_output_image1

Using converted .tflite file: tflite_output_image2 tflite_output_image1

Any help and guidance would be appreciated. Cheers:)

gadagashwini commented 2 years ago

Hi @9friday, Follow the instructions mentioned on the tutorial https://github.com/tensorflow/models/blob/master/research/object_detection/colab_tutorials/eager_few_shot_od_training_tflite.ipynb. Thank you!

google-ml-butler[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

google-ml-butler[bot] commented 2 years ago

Closing as stale. Please reopen if you'd like to work on this further.

google-ml-butler[bot] commented 2 years ago

Are you satisfied with the resolution of your issue? Yes No