【问题标题】:Wrong output from MobileNet SSD V2 converted tflite modelMobileNet SSD V2 转换的 tflite 模型的错误输出
【发布时间】:2020-02-25 05:12:32
【问题描述】:

我正在使用 TensorflowLite C++API 在 android 上开发对象检测应用程序。当我将ssd_mobilenet_v2_coco_2018_03_29 模型转换为 tflite 时,转换后的 tflite 模型的输出与相同测试图像上最初提供的 .pb 文件的输出不同。

将 .pb 文件转换为 .tflite

终端命令(我使用this link 寻求帮助。):

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

以上命令报错:

google.protobuf.text_format.ParseError: 109:7 : 消息类型 “object_detection.protos.SsdFeatureExtractor”没有名为的字段 “batch_norm_trainable”

按照here 建议的步骤后,错误已解决。我从“pipeline.config”文件中注释掉了“batch_norm_trainable”标签。

但是,转换后的 tflite 模型的检测输出与原始提供的 .pb 文件不同。如何将 .pb 文件转换为 .tflite 以便 .tflite 文件提供正确的输出?

输出图像:

  1. 使用 .pb(和 .pbtxt)文件:pb_output_image1 pb_output_image2
  2. 使用转换后的 .tflite 文件:tflite_output_image1 tflite_output_image2

使用的版本:

  • 操作系统:Ubuntu 18.04
  • 设备:QUALCOMM MSM8996 for arm64(开发板)(Android 9),摩托罗拉一电(Android 10)
  • TensorFlow版本(安装在Ubuntu上,用于转换):1.15
  • TensorFlow 版本(适用于 Android 设备中使用的 tflite,从源代码构建):2.1.0
  • Python 版本:3.6.9
  • Bazel 版本:2.0.0
  • GCC/编译器版本:8.3.0

任何帮助/指导将不胜感激。

干杯:)

【问题讨论】:

    标签: c++ android-ndk tensorflow-lite


    【解决方案1】:

    尝试使用 Keras 和 tensorflow 作为后端

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-05-29
      • 1970-01-01
      • 2019-06-10
      • 1970-01-01
      • 2020-04-16
      • 2020-12-18
      • 1970-01-01
      相关资源
      最近更新 更多