cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Hugo_K
Visitor
Visitor
165 Views
Registered: ‎01-22-2021

TF2 quantize flow - custom_quantize_strategy documentation

Hi,

Where can I find documentation about the custom_quantize_strategy json file ?

I found a json file in the Vitis-AI git repository (tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/vitis/vitis_8bit_default_quantize_strategy.json) but I don't find any documentation about this file and possible value and signification of each field.

Is there a documentation or exemples about a custom quantize strategy ?

The main interesting field for me is the method field. Is the value of this field the same as vai_q_tensorflow (command line for TF1 quantize flow) --method  parameters ?

 

3 Replies
jheaton
Xilinx Employee
Xilinx Employee
100 Views
Registered: ‎03-21-2008

Page 63 or UG1414 has an example with all the options. There is no method 0 or 1, as there was for the TF1 quantization flow.

Hugo_K
Visitor
Visitor
75 Views
Registered: ‎01-22-2021

Hi,

Did you read my post ?

I already see this page, and already use the quantize API with the default json file in the Vitis-AI repository but I want to change quantizer parameters.

In the json file there is a method field but undocummented value 0 or 1 (you can see the corresponding file here :  https://github.com/Xilinx/Vitis-AI/blob/master/tools/Vitis-AI-Quantizer/vai_q_tensorflow2.x/tensorflow_model_optimization/python/core/quantization/keras/vitis/vitis_8bit_default_quantize_strategy.json)

There is a method field and you can set it for each operation, but I don't found any documentation about it.

Is there a documentation about this json file ? (This is the question

0 Kudos
Reply
gguasti
Xilinx Employee
Xilinx Employee
39 Views
Registered: ‎11-29-2007

hi,

this JSON file format is not documented. I am checking internally.

In the meantime, method is the Quantization Method: 0 for non-overflow and 1 for min-diffs

0 Kudos
Reply