(Optional) Evaluating the Quantized Model - 3.5 English

Vitis AI User Guide (UG1414)

Document ID
Release Date
3.5 English

If you have scripts to evaluate float models, like the models in AMD Model Zoo, you can replace the float model file with the quantized model for evaluation.

To support the customized FixNeuron op, the vai_dquantize module should be imported. The following is an example:

import onnxruntime as ort
from vai_q_onnx.operators.vai_ops.qdq_ops import vai_dquantize

so = ort.SessionOptions()
sess = ort.InferenceSession(dump_model, so)
input_name = sess.get_inputs()[0].name
results_outputs = sess.run(None, {input_name: input_data})

After that, evaluate the quantized model just as the float model.