Skip to content

1.21.4

Choose a tag to compare

@PINTO0309 PINTO0309 released this 16 May 11:04
· 236 commits to main since this release
  • Add -odrqt, --output-dynamic-range-quantized-tflite option.
    While output_integer_quantized_tflite already enables dynamic range quantization output, the option also triggers checks for calibration data, which is only required for full integer quantization, and causes errors when no calibration data is provided.

    This is undesirable if only dynamic quantization is wanted.

    A new option (-odrqt, --output-dynamic-range-quantized-tflite) is added to only enable dynamic range quant output, which doesn't need calibration data.

    Before:

    $ onnx2tf -i some_model_with_non_regular_input_shape.onnx -oiqt
    (other output omitted)
    Model conversion started ============================================================
    INFO: input_op_name: input shape: [1] dtype: float32
    ERROR: For INT8 quantization, the input data type must be Float32. Also, if --custom_input_op_name_np_data_path is not specified, all input OPs must assume 4D tensor image data. INPUT Name: input INPUT Shape: [1] INPUT dtype: float32
    

    After:

    $ onnx2tf -i some_model_with_non_regular_input_shape.onnx -odrqt
    (other output omitted)
    saved_model output started ==========================================================
    saved_model output complete!
    WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
    W0000 00:00:1715853625.734342    7691 tf_tfl_flatbuffer_helpers.cc:390] Ignored output_format.
    W0000 00:00:1715853625.734397    7691 tf_tfl_flatbuffer_helpers.cc:393] Ignored drop_control_dependency.
    Float32 tflite output complete!
    W0000 00:00:1715853629.274694    7691 tf_tfl_flatbuffer_helpers.cc:390] Ignored output_format.
    W0000 00:00:1715853629.274724    7691 tf_tfl_flatbuffer_helpers.cc:393] Ignored drop_control_dependency.
    Float16 tflite output complete!
    W0000 00:00:1715853631.535535    7691 tf_tfl_flatbuffer_helpers.cc:390] Ignored output_format.
    W0000 00:00:1715853631.535568    7691 tf_tfl_flatbuffer_helpers.cc:393] Ignored drop_control_dependency.
    Dynamic Range Quantization tflite output complete!
    

What's Changed

Full Changelog: 1.21.3...1.21.4