This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA2EVM5777: Same outQ for different input frame ?

Part Number: TDA2EVM5777
Other Parts Discussed in Thread: TEST2

Hi,

I have caffe-jacinto trained network. And I am trying to import it in TIDL using tidlModelImport, while importing i am providing a test input as raw image (lets name is img1.y) . After successful import , I can see the outQ value for all the layers in stats.

During inferencing using eve_test_dl_algo.out.exe , if I provide same img1.y file . I am getting same outQ values same as import method. But, Now I have other test image (  img2.y ). If i run inference on this image, i should get different outQ values. But, I am getting same outQ values same as import method.

As per my understanding, tidlModelImport is one time process. After getting net.bin and param.bin, We can use same files for further inferences on different images.

 

Regards,

Sagar

  • TIDL 01.01 release has out args named dataQ for each output tensor. This output Q is updated for each process call.

    Refer TIDL test code for this out argument read or write

    The import time outQ is just initial value.

    Regards
    Kumar.D
  • I am using TIDL 00.08.00.00. And i checked the structure TIDL_outArgs do not have dataQ as structure member. Currently, I do not have TIDL 01.01. 00.00
    Is there any other way to get updated dataQ/outQ from TIDL 00.08.00.00 ?
  • No.

    Please migrate to the latest release (01.01)

    Regards,

    Kumar.D

  • Thanks Kumar.
    Though in the new release TIDL 01.01.00.00 , TIDL_outArgs and TIDL_inArgs are updated with dataQ . How it will help to calculate new quantization for each new input image. I will elaborate my problem.

    I am using TIDL 00.08.00.00 host emulation.
    I have 5 test images, test1, test2, test3, test4 and test5.

    and small network

    Layer0 (DataLayer),
    Layer1 (BatchNorm),
    Layer2 (Convolution),
    Layer3 (Pooling)

    I used test1 image during import and i have got net.bin and param.bin as ouput, also I got outQ for layer 1, 2 on terminal display.
    Now i have net.bin and param.bin file with me which i can use for any further inferencing.
    so, i used test2 image during inference. But, I am getting same outQ for layer 1, 2 on terminal display.
    Similarly, for all the test images other than test1, I am getting same outQ.

    Is it like, TIDL do not calculate new quat factor during inference?
    I can see for each LayerProcess
    e.g TIDL_batchNormProcess or TIDL_conv2dProcess in tidl_alg.c
    In that inDataParams = TIDL_getDataParams(&intAlgHandle->createParams->net, tidlLayer->inData[0].dataId) are updated from net.bin file which was saved with stats during import tool. Basically, these inDataParams must be updated for each new input. Then only we can get different quantization factor for each new input.

    Am i missing something? Please correct me.

    Regards,
    Sagar Kale
  • Hi Sagar,
    Please refer the "TIDL_updateMinMax" which is called in each layer processing (During inference also), which updates the min, max and "tidlLayer->outData[0].dataQ". This is the values read using "TIDL_getDataParams" in next process call.

    Regrads,
    Kumar.D