TDA4VH-Q1: embedding_extraction model PTQ quantization problem

Part Number: TDA4VH-Q1

Tool/software:

Hi.

I trained a recognition model for embedding extraction and performed quantization, but in the Inner Product layer the biasScale jumps to the FP32 representable maximum. The backbone is RegNetX-1200MF, and ONNX inference works fine, but I keep encountering issues during quantization. I’m using SDK 9.2, and I set features_bit to 16 for the embedding extraction layer. What could be the problem?

embedding_tidl_net.bin.zip

  • HI Jeong Kim,

    My first thought is to use TIDL 11x instead of an no longer supported version.  Many of these issues have been fixed over the past two years and more layers have been added.  I will review what you posted but the quickest solution to success will be with a newer SDK. 

    Regards,

    Chris

  • I solved this problem.

    PTQ on edgeai-tidl-tools was failed

    PTQ on TDA4 was passed

    what is different?

    below is my PTQ options.

  • Hi Jeong KIm,

    Impressive and congratulations.  I added text form of your options for others.  Thanks for the info.

    'person_reid_vOp2_fc_bias' : {
        'model_path' : os.path.join(eVWNet_base_path, 'person_reid_vOp2_fc_bias/person_reid_v0p2_Ic_bias.onnx'),
        'mean': [103.53, 116.20, 123.675],
        'scale' : [0.017429, 0.617507, 0.017125],
        'num images' : numImages,
        'num_classes'; 512,
        'model_type': ‘classification',
        'session_name' : ‘onnxrt',
        'framework': None,
        'accuracy level': 1,
        'optional_options' :
        {
            'advanced_opttons:calibratlon_frames' > 406,
            'advanced_options:calibration_iterations' : 10,
            "advanced_options:quantization_scale_type": 8,
            "advanced_options:quantRangeUpdateFactor": -1, # calibration value fixed
            "advanced_options:weight_clipping": 1,
            "advanced_options:bias_calibration": 1,
            #'advanced _options:activation_clipping": 1,
            "advanced options:output_feature_16bit_names_list": ' \
                /backbone/Layer4/Layer4.4/act3/Relu_output_0, \
                embedding',
            "advanced_oplions:params_16bit_names_list": ' \
               /backbone/embedding/Gemm, embedding' ,
            "tensor_bits": 8,
        },
    }
    

    Thanks,

    Chris