1.下载tensorflow源码
git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git
2.通过export_tflite_ssd_graph.py将训练后的模型导出所需要的文件
配置参数为
--pipeline_config_path=/home/jinyan/anaconda3/envs/tensorflow/models/research/object_detection/sm_products/MODEL_13/sm_pipeline.config
--trained_checkpoint_prefix=/home/jinyan/anaconda3/envs/tensorflow/models/research/object_detection/sm_products/MODEL_13/train/model.ckpt-39745
--output_directory=/home/jinyan/anaconda3/envs/tensorflow/models/research/object_detection/sm_products/MODEL_13/model_lite
--add_postprocessing_op=true
运行后将在output_directory目录生成 tflite_graph.pb 和 tflite_graph.pbtxt 两个文件。