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.

TDA4 : Find difference output between evm and PC-emulation by using vision_apps with custom layer

Dear Sir,

I am using psdk_rtos_auto_j7_06_02_00_21 and trying to make the model with custom layer.

The layer-level output of evm is same as PC-emulation. The config setting are flowctrl = 16 on evm and flowctrl = 20 on PC-emulation .

I guess that model has already pass the TIDL standalone test.

  

When I try to change the model in app_tidl. I got the different outputs between evm and PC-emulation.

The output from evm is same as TIDL standalone test.

When I remove the custom layer, all of the outputs are same.

  

So, my questions are:

In my opinion, the outputs from app_tidl should be the same between PC-emulation and evm. 

What's the problems may happen and how to figure it out?

The following files are models and configs that I made from TIDL:

with_custom_layer.zip  without_custom_layer.zip

Thanks and Regards,

Ted

  • Hi Ted,

    Can you share the changes you made in app_tidl to run custom layer?

    Regards,

    Rishabh

  • Hi Rishabh:

      

    I've added the following line in tiovx/lernels_j7/tidl/dsp/:

    tidlObj->createParams.TIDLWriteBinToFile = tivxKernelTIDLDumpToFile;

    + ) tidlObj->createParams.TIDL_CustomLayerProcess = TIDL_customLayerProcess;

        

    Then I modify STATIC_LIBS and LDIRS  in some concerto.mak files.

    1.psdk_rtos_auto_j7_06_02_00_21\tiovx\kernels_j7\concerto_inc.mak
    +  STATIC_LIBS += tidl_custom
    +  LDIRS+= $(PSDK_PATH)/tidl_j7_01_01_00_10/ti_dl/lib/PC/dsp/algo/$(TARGET_BUILD)

    2.psdk_rtos_auto_j7_06_02_00_21\vision_apps\apps\concerto_x86_64_inc.mak
    +  STATIC_LIBS += tidl_custom
    +  LDIRS+= $(PSDK_PATH)/tidl_j7_01_01_00_10/ti_dl/lib/PC/dsp/algo/$(TARGET_BUILD)

    3.psdk_rtos_auto_j7_06_02_00_21\tiovx\psdkra_tools_path.mak
    +  TIDL_CUSTOM_PATH ?= $(PSDK_PATH)/tidl_j7_01_00_00_10/ti_dl/custom

      

    In main.c, I turn on the  APP_TIDL_TRACE_DUMP.

    Then, I disable the function displayOutput and change the following line in readInput function.

    uint32_t offset = ((16 + i) * 256) + 16;  ->   uint32_t offset = i* 256;

    resizeImage(pInPlanes, pOutPlanes, img_width, img_height, img_width, 256, 256, 256); ->
    resizeImage(pInPlanes, pOutPlanes, img_width, img_height, img_width, img_width, img_height, img_width); 
       
    chOffset = 256*256; -> chOffset =img_height * img_width;
       
       
    But I consider the changes that won't be the problem.

    Because the layer-level trace are different between PC-emulation and evm.

    The difference is happened in the next layer-index of custom layer.

       

    Thanks,

    Ted

  • Hi Rishabh:

      

    When I set flowctrl=2 in TIDL inference config, I got the same output between app_tidl on PC-emulation and TIDL standalone on PC-emulation.

    When I set flowctrl=20 in TIDL inference config, I got the different output between app_tidl and TIDL standalone on PC-emulation.

    Maybe this clue can help.

    Thanks,

    Ted

  • Hi Ted,

    Can you clarify "I guess that model has already pass the TIDL standalone test".

    Can you confirm if the model working in standalone?

    What happens when you set flowCtrl = 1 between app_tidl and TIDL_standalone?

    Regards,

    Rishabh

  • Hi Rishabh:

      

    I've already solve this problm.

    It caused by the bad memory declared in tidl_custom.

      

    Thanks and Regards,

    Ted

  • Hi Ted,

    Thanks for the update.

    I will close this thread.

    Regards,

    Rishabh