ComputeLibrary icon indicating copy to clipboard operation
ComputeLibrary copied to clipboard

Create QuantizationInfo for my graph

Open krgor opened this issue 7 years ago • 4 comments

utput of 'strings libarm_compute.so | grep arm_compute_version': ACL Version: 19.02

Platform:

Operating System: Android 7.1.1

Currently I am trying to use QASYMM8 for my small graph. My graph is working well with F32. Considering the reference of graph_mobilenet.cpp, I am not sure how did you derive the QuantizationInfo values mentioned in graph_mobilenet.cpp like below:

    const std::vector<QuantizationInfo> conv_weights_quant_info =
    {
        QuantizationInfo(0.031778190285f, 156), // conv0
        QuantizationInfo(0.00604454148561f, 66) // conv14
    };

Can you please help me out how can I derive similar Quantization values for my graph?

Thanks, KGor

krgor avatar Apr 29 '19 17:04 krgor

Hi @krgor

These values come from the model, you could download any of the quantized models from https://www.tensorflow.org/lite/guide/hosted_models and see that they have these values for each layer.

Quantization is determined during the process of training a network or as a post-process by converting a float model to quantized. Take a look at the following link: https://www.tensorflow.org/lite/performance/post_training_quantization

Hope this helps.

morgolock avatar Apr 30 '19 09:04 morgolock

@morgolock, thanks for your reply.

I have tried to get more information from the tflite hosted models. I have downloaded http://download.tensorflow.org/models/mobilenet_v1_2018_08_02/mobilenet_v1_0.25_128_quant.tgz model. Can you please tell me which file do I need to check to see the QuantizationInfo?

I have seen "mobilenet_v1_0.25_128_quant_eval.pbtxt" and "mobilenet_v1_0.25_128_quant_info.txt" but could not find anything specific to QuantizationInfo. Do I need to extract some details from the frozen graph?

Any hint would be very much helpful.

Regards, KGor

krgor avatar May 07 '19 14:05 krgor

Hi @krgor

I'd advice you to take a look at the model using a visualisation tool like https://github.com/lutzroeder/netron. For example you can load the tflite file and then click on any node to read their corresponding parameters.

qinfo

Hope this helps.

morgolock avatar May 10 '19 13:05 morgolock

Hi @morgolock

Thank you so much for your valuable suggestion. Provided details are helping me to build my graph.

Regards, KGor

krgor avatar May 12 '19 16:05 krgor