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.

TDA4VH-Q1: when disable OTF buffer optimizations, the result of Deconv2DLayer is error on board

Part Number: TDA4VH-Q1

Tool/software:

when disable OTF buffer optimizations, the result of Deconv2DLayer  is error on board

I test with the sdk: ti-processor-sdk-rtos-j784s4-evm-09_02_00_05.tar.gz

 

I provide the onnx file and import config.  

/cfs-file/__key/communityserver-discussions-components-files/791/deconv.zip

  • Hi Guang Ren;

    I have downed your onnx file, device config. But I could not compile your model on the host side yet. Could you please provide the scripts that you are using, such as "model_configs.py?

    For first step, I want to repeat you what have done first.

    Thanks and regards

    Wen Li

  • you can see the model config file:tidl_import_east_single.txt
    I run the command: ./tidl_model_import.out  ./tidl_import_east_single.txt  

  • I have tried two methods to disable OTF optimization, and the effects are the same.

    The first method is to set deviceName=0

    The second method is to force set disableOtf to true in the function TIDL_correctDeviceConfig (thefunciton in the tidl_import_core.cpp)

    If the OTF optimization is disabled, the result will be incorrect.

  • Hi Guang; thank you for the info. I am setting up the system now. Will provide update soon. 

    regards

    Wen Li

  • Hi Guang;

    I have some updates/insight from our development team. hope these will answer your question.  

    Basically; Custom layer based approach does not support OTF mode, so it is not recommended to set in your code.

    Yes, there is a Deconv (TransposeConvolution) issue in old version, but the TIDL 10.0+ version has fixed the Deconv issues.

    Thanks and regards

    Wen Li

  • Hi Guang;

    I have tried to set up the exactly same file directory structure as you have. And ran the "tidl_model_import.out"

    I got the bin file, but there are some warning messages; so the bin file may not work. Below is the warning messages and the screenshot after I did the importing.

    My edgeai-tidl installation seems different than your. I don't have the "utils" directory. Yet my tidl_model_import.out is still looking for the two .out files it.

    So I think it may be the tidl utility file problem. I will try to fix that. I don't know if you see these warning messages.

    Also in your tidl_import_east_single.txt, there is a inData

    inData = ../../test/testvecs/models/public/bm_model/onnx/east_single/quant_data/ref_image_list.txt

    But they are not in your zip file. Maybe they are not important for now. But please see my screenshot below. And let me know.

    thanks and regards

    Wen Li

  • What is your edgeai-tidl-tools version? I can use the latest one, but it may not match yours.

    Thanks and regards

    Wen Li

  • The data can be randomly generated; quantized data does not affect the conclusion.

    I did not use the edgeai-tidl-tools tool.

    I run the command  "./out/tidl_model_import.out  ./tidl_import_east_single.txt " in the c7x-mma-tidl/tidl/utils/tidlModelImport directory

    The  device_config.cfg , ti_cnnpersim.out and tidl_graphVisualiser.out  are all in your tidl_tools directory.

    And you can modify tidl_import_smoke.txt to change their search paths. 

  • Hi; I understood and I ran the model-import the same way as you did. Here is the log file from my running.

    Please let me know whether or not this matched with your running. 

    We will continue the next step to the patch version.

    Thanks and regards

    Current ONNX OpSet Version   : 11  
    Running tidl_optimizeNet 
    printing Current net
        0|TIDL_DataLayer                |                                                  |Relu_44                                           |    0|    0|
        1|TIDL_DataLayer                |                                                  |Relu_38                                           |    0|    1|
        2|TIDL_ConvolutionLayer         |Relu_44                                           |Conv_45                                           |    0|    2|
        3|TIDL_ReLULayer                |Conv_45                                           |Relu_46                                           |    2|    3|
        4|TIDL_ConvolutionLayer         |Relu_46                                           |Conv_47                                           |    3|    4|
        5|TIDL_EltWiseLayer             |Conv_47                                           |Add_48                                            |    4|    5|
        6|TIDL_ReLULayer                |Add_48                                            |Relu_49                                           |    5|    6|
        7|TIDL_Deconv2DLayer            |Relu_49                                           |ConvTranspose_50                                  |    6|    7|
        8|TIDL_ConcatLayer              |ConvTranspose_50                                  |Concat_51                                         |    7|    8|
        9|TIDL_ConvolutionLayer         |Concat_51                                         |Conv_52                                           |    8|    9|
       10|TIDL_ReLULayer                |Conv_52                                           |Relu_53                                           |    9|   10|
       11|TIDL_ConvolutionLayer         |Relu_53                                           |Conv_54                                           |   10|   11|
       12|TIDL_ReLULayer                |Conv_54                                           |Relu_55                                           |   11|   12|
       13|TIDL_Deconv2DLayer            |Relu_55                                           |ConvTranspose_56                                  |   12|   13|
       14|TIDL_DataLayer                |ConvTranspose_56                                  |ConvTranspose_56                                  |   13|    0|
    Completed tidl_optimizeNet 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Raw data format used is same as inElementType 0 
    Empty prototxt path, running calibration
    Num of Layer Detected :  11 
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Num|TIDL Layer Name               |Out Data Name                                     |Group |#Ins  |#Outs |Inbuf Ids                       |Outbuf Id |In NCHW                             |Out NCHW                            |MACS       |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        0|TIDL_DataLayer                |Relu_44                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  0       |       0        0        0        0        0        0 |       1        1        1       64       16       16 |         0 |
        1|TIDL_DataLayer                |Relu_38                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  1       |       0        0        0        0        0        0 |       1        1        1       64       32       32 |         0 |
        2|TIDL_ConvolutionLayer         |Relu_46                                           |     0|     1|     1|  0   x   x   x   x   x   x   x |  2       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        3|TIDL_ConvolutionLayer         |Conv_47                                           |     0|     1|     1|  2   x   x   x   x   x   x   x |  3       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        4|TIDL_EltWiseLayer             |Relu_49                                           |     0|     2|     1|  3   0   x   x   x   x   x   x |  4       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |     16384 |
        5|TIDL_Deconv2DLayer            |ConvTranspose_50                                  |     0|     1|     1|  4   x   x   x   x   x   x   x |  5       |       1        1        1       64       16       16 |       1        1        1       64       32       32 |  67108864 |
        6|TIDL_ConcatLayer              |Concat_51                                         |     0|     2|     1|  5   1   x   x   x   x   x   x |  6       |       1        1        1       64       32       32 |       1        1        1      128       32       32 |    131072 |
        7|TIDL_ConvolutionLayer         |Relu_53                                           |     0|     1|     1|  6   x   x   x   x   x   x   x |  7       |       1        1        1      128       32       32 |       1        1        1       32       32       32 |   4194304 |
        8|TIDL_ConvolutionLayer         |Relu_55                                           |     0|     1|     1|  7   x   x   x   x   x   x   x |  8       |       1        1        1       32       32       32 |       1        1        1       32       32       32 |   9437184 |
        9|TIDL_Deconv2DLayer            |ConvTranspose_56                                  |     0|     1|     1|  8   x   x   x   x   x   x   x |  9       |       1        1        1       32       32       32 |       1        1        1       32       64       64 |  67108864 |
       10|TIDL_DataLayer                |ConvTranspose_56                                  |     0|     1|    -1|  9   x   x   x   x   x   x   x |  0       |       1        1        1       32       64       64 |       0        0        0        0        0        0 |         0 |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Total Giga Macs : 0.1669
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Num of Layer Detected :  11 
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Num|TIDL Layer Name               |Out Data Name                                     |Group |#Ins  |#Outs |Inbuf Ids                       |Outbuf Id |In NCHW                             |Out NCHW                            |MACS       |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        0|TIDL_DataLayer                |Relu_44                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  0       |       0        0        0        0        0        0 |       1        1        1       64       16       16 |         0 |
        1|TIDL_DataLayer                |Relu_38                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  1       |       0        0        0        0        0        0 |       1        1        1       64       32       32 |         0 |
        2|TIDL_ConvolutionLayer         |Relu_46                                           |     0|     1|     1|  0   x   x   x   x   x   x   x |  2       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        3|TIDL_ConvolutionLayer         |Conv_47                                           |     0|     1|     1|  2   x   x   x   x   x   x   x |  3       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        4|TIDL_EltWiseLayer             |Relu_49                                           |     0|     2|     1|  3   0   x   x   x   x   x   x |  4       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |     16384 |
        5|TIDL_Deconv2DLayer            |ConvTranspose_50                                  |     0|     1|     1|  4   x   x   x   x   x   x   x |  5       |       1        1        1       64       16       16 |       1        1        1       64       32       32 |  67108864 |
        6|TIDL_ConcatLayer              |Concat_51                                         |     0|     2|     1|  5   1   x   x   x   x   x   x |  6       |       1        1        1       64       32       32 |       1        1        1      128       32       32 |    131072 |
        7|TIDL_ConvolutionLayer         |Relu_53                                           |     0|     1|     1|  6   x   x   x   x   x   x   x |  7       |       1        1        1      128       32       32 |       1        1        1       32       32       32 |   4194304 |
        8|TIDL_ConvolutionLayer         |Relu_55                                           |     0|     1|     1|  7   x   x   x   x   x   x   x |  8       |       1        1        1       32       32       32 |       1        1        1       32       32       32 |   9437184 |
        9|TIDL_Deconv2DLayer            |ConvTranspose_56                                  |     0|     1|     1|  8   x   x   x   x   x   x   x |  9       |       1        1        1       32       32       32 |       1        1        1       32       64       64 |  67108864 |
       10|TIDL_DataLayer                |ConvTranspose_56                                  |     0|     1|    -1|  9   x   x   x   x   x   x   x |  0       |       1        1        1       32       64       64 |       0        0        0        0        0        0 |         0 |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Total Giga Macs : 0.1669
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    INFO : Couldn't open inData file: ../../test/testvecs/models/public/bm_model/onnx/east_single/quant_data/ref_image_list.txt  , Skipping Range Collection for Quantization 
    
     
     
     *****************   Calibration iteration number 0 started ************************ 
     
     
     
    Empty prototxt path, running calibration
    Warning :: Weight Scale Clipped -      28.28,     355.31,      12.56,    0,  0,    3, Conv_47 
    Warning :: Weight Scale Clipped -     155.99,    1464.35,       9.39,    1,  0,    7, Conv_52 
    Warning :: Weight Scale Clipped -     235.75,     349.40,       1.48,    0,  0,    8, Conv_54 
    Num of Layer Detected :  11 
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Num|TIDL Layer Name               |Out Data Name                                     |Group |#Ins  |#Outs |Inbuf Ids                       |Outbuf Id |In NCHW                             |Out NCHW                            |MACS       |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        0|TIDL_DataLayer                |Relu_44                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  0       |       0        0        0        0        0        0 |       1        1        1       64       16       16 |         0 |
        1|TIDL_DataLayer                |Relu_38                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  1       |       0        0        0        0        0        0 |       1        1        1       64       32       32 |         0 |
        2|TIDL_ConvolutionLayer         |Relu_46                                           |     0|     1|     1|  0   x   x   x   x   x   x   x |  2       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        3|TIDL_ConvolutionLayer         |Conv_47                                           |     0|     1|     1|  2   x   x   x   x   x   x   x |  3       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        4|TIDL_EltWiseLayer             |Relu_49                                           |     0|     2|     1|  3   0   x   x   x   x   x   x |  4       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |     16384 |
        5|TIDL_Deconv2DLayer            |ConvTranspose_50                                  |     0|     1|     1|  4   x   x   x   x   x   x   x |  5       |       1        1        1       64       16       16 |       1        1        1       64       32       32 |  67108864 |
        6|TIDL_ConcatLayer              |Concat_51                                         |     0|     2|     1|  5   1   x   x   x   x   x   x |  6       |       1        1        1       64       32       32 |       1        1        1      128       32       32 |    131072 |
        7|TIDL_ConvolutionLayer         |Relu_53                                           |     0|     1|     1|  6   x   x   x   x   x   x   x |  7       |       1        1        1      128       32       32 |       1        1        1       32       32       32 |   4194304 |
        8|TIDL_ConvolutionLayer         |Relu_55                                           |     0|     1|     1|  7   x   x   x   x   x   x   x |  8       |       1        1        1       32       32       32 |       1        1        1       32       32       32 |   9437184 |
        9|TIDL_Deconv2DLayer            |ConvTranspose_56                                  |     0|     1|     1|  8   x   x   x   x   x   x   x |  9       |       1        1        1       32       32       32 |       1        1        1       32       64       64 |  67108864 |
       10|TIDL_DataLayer                |ConvTranspose_56                                  |     0|     1|    -1|  9   x   x   x   x   x   x   x |  0       |       1        1        1       32       64       64 |       0        0        0        0        0        0 |         0 |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Total Giga Macs : 0.1669
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    INFO : Couldn't open inData file: ../../test/testvecs/models/public/bm_model/onnx/east_single/quant_data/ref_image_list.txt  , Skipping Range Collection for Quantization 
    
     
     
     *****************   Calibration iteration number 0 completed ************************ 
     
     
     
    Empty prototxt path, running calibration
    Warning :: Weight Scale Clipped -      28.28,     355.31,      12.56,    0,  0,    3, Conv_47 
    Warning :: Weight Scale Clipped -     155.99,    1464.35,       9.39,    1,  0,    7, Conv_52 
    Warning :: Weight Scale Clipped -     235.75,     349.40,       1.48,    0,  0,    8, Conv_54 
    Num of Layer Detected :  11 
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      Num|TIDL Layer Name               |Out Data Name                                     |Group |#Ins  |#Outs |Inbuf Ids                       |Outbuf Id |In NCHW                             |Out NCHW                            |MACS       |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
        0|TIDL_DataLayer                |Relu_44                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  0       |       0        0        0        0        0        0 |       1        1        1       64       16       16 |         0 |
        1|TIDL_DataLayer                |Relu_38                                           |     0|    -1|     1|  x   x   x   x   x   x   x   x |  1       |       0        0        0        0        0        0 |       1        1        1       64       32       32 |         0 |
        2|TIDL_ConvolutionLayer         |Relu_46                                           |     0|     1|     1|  0   x   x   x   x   x   x   x |  2       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        3|TIDL_ConvolutionLayer         |Conv_47                                           |     0|     1|     1|  2   x   x   x   x   x   x   x |  3       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |   9437184 |
        4|TIDL_EltWiseLayer             |Relu_49                                           |     0|     2|     1|  3   0   x   x   x   x   x   x |  4       |       1        1        1       64       16       16 |       1        1        1       64       16       16 |     16384 |
        5|TIDL_Deconv2DLayer            |ConvTranspose_50                                  |     0|     1|     1|  4   x   x   x   x   x   x   x |  5       |       1        1        1       64       16       16 |       1        1        1       64       32       32 |  67108864 |
        6|TIDL_ConcatLayer              |Concat_51                                         |     0|     2|     1|  5   1   x   x   x   x   x   x |  6       |       1        1        1       64       32       32 |       1        1        1      128       32       32 |    131072 |
        7|TIDL_ConvolutionLayer         |Relu_53                                           |     0|     1|     1|  6   x   x   x   x   x   x   x |  7       |       1        1        1      128       32       32 |       1        1        1       32       32       32 |   4194304 |
        8|TIDL_ConvolutionLayer         |Relu_55                                           |     0|     1|     1|  7   x   x   x   x   x   x   x |  8       |       1        1        1       32       32       32 |       1        1        1       32       32       32 |   9437184 |
        9|TIDL_Deconv2DLayer            |ConvTranspose_56                                  |     0|     1|     1|  8   x   x   x   x   x   x   x |  9       |       1        1        1       32       32       32 |       1        1        1       32       64       64 |  67108864 |
       10|TIDL_DataLayer                |ConvTranspose_56                                  |     0|     1|    -1|  9   x   x   x   x   x   x   x |  0       |       1        1        1       32       64       64 |       0        0        0        0        0        0 |         0 |
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Total Giga Macs : 0.1669
    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    cp /home/a0199881local/Downloads/ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/c7x-mma-tidl/ti_dl/test/testvecs/config/import/device_config.cfg /home/a0199881local/Downloads/ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/c7x-mma-tidl/ti_dl/test/testvecs/config/tidl_models/bm_model/onnx/east_single/tidl_import_east_single.txt.perf_sim_config.txt
    cd /home/a0199881local/Downloads/ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/c7x-mma-tidl/ti_dl/utils/perfsim && ./ti_cnnperfsim.out /home/a0199881local/Downloads/ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/c7x-mma-tidl/ti_dl/test/testvecs/config/tidl_models/bm_model/onnx/east_single/tidl_import_east_single.txt.perf_sim_config.txt 1601 0 2
    
    ------------------ Network Compiler Traces -----------------------------
    Segmentation fault (core dumped)
    Could not open /home/a0199881local/Downloads/ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/c7x-mma-tidl/ti_dl/test/testvecs/config/tidl_models/bm_model/onnx/east_single/onnx/perfSimInfo.bin
    /home/a0199881local/Downloads/ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/c7x-mma-tidl/ti_dl/utils/tidlModelGraphviz/out/tidl_graphVisualiser.out ../../test/testvecs/config/tidl_models/bm_model/onnx/east_single/tidl_net_onnx.bin
    /home/a0199881local/Downloads/ti-processor-sdk-rtos-j784s4-evm-09_02_00_05/c7x-mma-tidl/ti_dl/utils/tidlModelDump/out/tidl_dump.out -model ../../test/testvecs/config/tidl_models/bm_model/onnx/east_single/tidl_net_onnx.bin -io ../../test/testvecs/config/tidl_models/bm_model/onnx/east_single/tidl_io_onnx_1.bin -perfsim -o ../../test/testvecs/config/tidl_models/bm_model/onnx/east_single/tidl_net_onnx.bin.txt
    ****************************************************
    **               TIDL Model Checker               **
    ****************************************************
    SUGGESTION: [TIDL_Deconv2DLayer] ConvTranspose_50 Please change to Upsample/Resize if possible. Upsample/Resize will be more efficient.
    SUGGESTION: [TIDL_Deconv2DLayer] ConvTranspose_56 Please change to Upsample/Resize if possible. Upsample/Resize will be more efficient.
    TIDL ALLOWLISTING LAYER CHECK: TIDL_E_QUANT_STATS_NOT_AVAILABLE] tidl_quant_stats_tool.out fails to collect dynamic range. Please look into quant stats log. This model will get fault on target.
    WARNING: [TIDL_E_DATAFLOW_INFO_NULL] Network compiler returned with error or didn't executed, this model can only be used on PC/Host emulation mode, it is not expected to work on target/EVM.
    ****************************************************
    **          3 WARNINGS          1 ERRORS          **
    ****************************************************
    
    
    Wen Li

  • Hello Guang;

    I was able to create a patch version of SDK 9.2. And with that, I successfully imported your model without any error. I will contact our local FAE to present my results, and make sure everything is OK. They will communicate with you if you have question. And then we will close this ticket.

    Screenshot is the result when I was running the model import of the patch version.

    Thanks and regards

    Wen Li 

  • Issue Tracking in TI system: TIDL-7340