The vai_q_tensorflow supports data type conversions for float models, including Float16,
BFloat16, Float, and Double. To achieve this, you can add
convert_datatype argument to the vai_q_tensorflow command.
$vai_q_tensorflow quantize \
--input_frozen_graph frozen_graph.pb \
--input_nodes ${input_nodes} \
--input_shapes ${input_shapes} \
--output_nodes ${output_nodes} \
--input_fn input_fn \
--convert_datatype 1 \
[options]
- convert_datatype
- Int, specifies the target datatype to convert to. Options are: 1 for Float16, 2 for Double, 3 for BFloat16 and 4 for Float. The default value is 0.
Note: In order to implement the conversion, BatchNorm operation will
be folded in advance.