tensorflow / tensorflow/models

[Deeplab] The iou of unit8 tflite have a sharp decline

Open
#8,684 14 comments 0 reactions 3 assignees View on GitHub

@aquariusjay is already working on this.

Since Jun 16, 2020.

models:research type:bug
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [N ] I am using the latest TensorFlow Model Garden release and TensorFlow 2.
  • [ Y] I am reporting the issue to the correct repository. (Model Garden official or research directory)
  • [Y ] I checked to make sure that this issue has not already been filed.

1. The entire URL of the file you are using

https://github.com/tensorflow/models/tree/master/research/deeplab

2. Describe the bug

The mIou of uint8 tflite have a sharp decline

3. Steps to reproduce

using Quantization-aware training on my own datasets. The iou of ckpt is 87.98.
Convert ckpt to pb file, the iou of pb model is 87.84
Convert pb to tflite, <inference_type=FLOAT>,Then, the iou of float tflite is 87.89
Convet pb to tflite, <inference_type=QUANTIZED_UINT8>,Then, the iou of float tflite is 54.6
the convert_tflite code is followed strictly "https://github.com/tensorflow/models/blob/master/research/deeplab/g3doc/quantize.md"
'tflite_convert
--graph_def_file=${OUTPUT_DIR}/frozen_inference_graph.pb
--output_file=${OUTPUT_DIR}/frozen_inference_graph.tflite
--output_format=TFLITE
--input_shape=1,321,321,3
--input_arrays="MobilenetV2/MobilenetV2/input"
--inference_type=QUANTIZED_UINT8
--inference_input_type=QUANTIZED_UINT8
--std_dev_values=128
--mean_values=128
--change_concat_input_ranges=true
--output_arrays="ArgMax"'

4. Expected behavior

I want to know how to quantize the mobilenetv2 deeplab so that its iou has a small drop.

5. Additional context

None

6. System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
  • Mobile device name if the issue happens on a mobile device:
  • TensorFlow installed from (source or binary):
  • TensorFlow version (use command below):1.15.0
  • Python version:3.6
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.