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.

CCS: TDA4x: convolution initialization error in TF based model



Tool/software: Code Composer Studio

Dear Sir, 

With reference to the last post 

https://e2e.ti.com/support/processors/f/791/p/855997/3167091#pi320966filter=all&pi320966scroll=false&pi320966=2

I am sharing you the details of "layer 78"

  1. Layer name in tensorflow graph - DASNet/RF_module_1/block/reduce/separable_conv2d/separable_conv2d/depthwise
  2. Type - Depthwise convolution.
  3. Mapped to TIDL layer type - TIDL_ConvolutionLayer
  4. Operation name - DepthwiseConv2dNative
  5. Input tensor dimensions (in NCHW format) – (1, 128, 19, 19)
  6. Output tensor dimensions (in NCHW format) - (1, 128, 19, 19)
  7. Convolution kernel size – (1, 1)
  8. Number of convolution kernels kernel – 128
  9. Strides – (1, 1)
  10. Padding type used – SAME
  11. Dilation rate – (1, 1)

Thanks and Regards,

Vyom Mishra

  • Hi Vyom,
         We currently don't support depth wise separable convolution with kernel size of 1x1. We have not come across a netowork where depth wise separable convolution is used with 1x1 coefficient dimensions. Typically 1x1 kernels are used in normal CNN style convolution (non depthwise separable convolution), which is supported in TIDL. 


    Regards,

    Anshu

  • Hi Anshu,

    The model ran in PC emulation. If the depthwise separable convolutions with 1x1 kernel were not supported in TIDL, shouldn't it have failed in PC emulation too.

    Best Regards,

    Sankalp 

  • Hi Sankalp,

        PC emulation mode run reference code which is a generic code for all convolution, on the other hand  target code has specific optimization for depth wise separable layers and currently doesn't support 1x1 convolution.


    Regards,

    Anshu

  • Hi Anshu,

    We have replaced the kernel size from 1*1 to 3*3

    After successfully importing , we have verified the results from trace dumps. 

    When we are running the model on the board, we are facing the same issue with layer number 1. Please find error for your reference.

    Alg Init for Layer # - 0
    Alg Init for Layer # - 1
    MMALIB_CNN_convolve_col_smallNo_ixX_ixX_oxX_init 1 :FAILED
    Algorithm Init failed with error number: -1
    Error at line: 479 : in file src/tidl_tb.c, of function : tidlMultiInstanceTest
    Invalid Error Type!

    I am sharing you the information of layer number 1 as below:

    1.       Layer name in tensorflow graph - DASNet/depthwise_conv/separable_conv2d/separable_conv2d/depthwise
    2.       Type - Depthwise convolution.
    3.       Mapped to TIDL layer type - TIDL_ConvolutionLayer
    4.       Operation name - DepthwiseConv2dNative
    5.       Input tensor dimensions (in NCHW format) – (1, 3, 608, 608)
    6.       Output tensor dimensions (in NCHW format) - (1, 3, 602, 602)
    7.       Convolution kernel size – (7, 7)
    8.       Number of convolution kernels kernel – 3
    9.       Strides – (1, 1)
    10.   Padding type used – VALID
    11.   Dilation rate – (1, 1)

    Kindly suggest your views on this issue.

    Regards,

    Anshuman

  • Hi Anshuman,
        Are you running this layer in 8-bit mode or 16-bit mode?

    Regards,

    Anshu

  • Hi Anshu,

    Can you please specify what do you mean by running any layer in 8/16 bit mode?

    As of my understanding 

    we have used 

    numparambits = 8

    numfeaturebit = 8

    while importing the model.

    Regards,

    Anshuman

  • Hi Anshuman,

       From the parameters you are running in 8 bit mode. I don't see any specific reason for init to fail. Can you share a small dummy network with just this layer so that we can see the behavior at our end.


    Regards,

    Anshu

  • Dear Sir,

    Please find the model attached.single_layer_model.zip

    Thanks and Regards,

    Vyom Mishra

  • Dear Sir,

    Gentle Reminder!

    Any updates on this.

    Thanks and Regards,

    Vyom Mishra

  • Hi Vyom,

       We need a bit of time for this. Can you also share the import and infer config files which you have used?

    Regards,

    Anshu

  • Dear Sir,

    Please find the import and inference configuration file for your reference.

    modelType = 1
    inputNetFile = "C:\Users\vipin\Desktop\single_layer_model\protobuf_files\optimized_single_layer_model.pb"
    inputParamsFile = "NA"
    outputNetFile = "C:\Users\vipin\Desktop\single_layer_model\TIDL_files\single_layer_net.bin"
    outputParamsFile   = "C:\Users\vipin\Desktop\single_layer_model\TIDL_files\single_layer_param_"
    tidlStatsTool = "C:\Users\vipin\Desktop\TI-TF_import\TDA4x_raw\tidl_j7_01_00_00_00\ti_dl\test\tidl_quant_stats_tool.out.exe"
    numParamBits = 8
    numFeatureBits = 8
    quantizationStyle = 2
    inQuantFactor = 255.0
    foldBnInConv2D = 1
    metaArchType = -1
    inFileFormat = 1
    numFrames = 1
    inElementType = 0
    inWidth  = 608
    inHeight = 608
    inNumChannels = 3
    postProcType = 0
    inDataFormat = 1
    preProcType  = 0
    inData = "C:\Users\vipin\Desktop\TI-TF_import\Import_Tools\TIDL_import_tool_v1.4\model_data\test_images_tidl_raw\BGT-07_20190225121648_G_360_resized_raw.raw"
    perfSimConfig = "C:\Users\vipin\Desktop\TI-TF_import\TDA4x_raw\tidl_j7_01_00_00_00\ti_dl\test\testvecs\config\import\perfsim_base.cfg"
    perfSimTool = "C:\Users\vipin\Desktop\TI-TF_import\TDA4x_raw\tidl_j7_01_00_00_00\ti_dl\utils\perfsim\ti_cnnperfsim.out.exe"
    

    inFileFormat    = 1
    postProcType = 2
    numFrames   = 1
    #padInBuffInTB = 0
    netBinFile      = "/home/vyom/psdk_rtos_auto_j7_06_00_00_00/tidl_j7_00_09_00_00/ti_dl/test/testvecs/config/tidl_models/tensorflow/DASNet/tidl_net_DASNet_608x608.bin"
    ioConfigFile   = "/home/vyom/psdk_rtos_auto_j7_06_00_00_00/tidl_j7_00_09_00_00/ti_dl/test/testvecs/config/tidl_models/tensorflow/DASNet/tidl_io_DASNet_608x608_1.bin"
    inData  =   "/home/vyom/psdk_rtos_auto_j7_06_00_00_00/tidl_j7_00_09_00_00/ti_dl/test/testvecs/input/Image_DASNet.raw"
    outData =   testvecs/output/DASNet_out_PC.bin
    debugTraceLevel = 1
    writeTraceLevel = 1
    writeOutput = 1
    

    Thanks and Regards,

    Vyom Mishra

  • Dear Sir,

    Gentle Reminder!

    Any updates on this.

    Thanks and Regards,

    Vyom Mishra

  • Hi Vyom,  

        The issue is coming because the output of this layer is coming as signed output, which is currently not handled in our optimized implementation. To move forward can you have a Relu layer after this convolution? In the mean time I will figure out if we can support this or not ( I think there should not be an issue in supporting this but I want to check with our team here).


    Regards,

    Anshu

  • Dear Sir,

    Thanks for the information!

    We are trying on our side to modify the network as per your suggestion.

    Is there any update from your side on this.

    Thanks and Regards,

    Vyom Mishra

  • Hi Vyom,

       The fix for this will be available in our next release.

    Regards,

    Anshu

  • Dear Anshu,

    Could you let us know when you would be releasing the next release so that we can sync up our development activities accordingly.

    Best Regards,

    Sankalp

  • Hi Sankalp,

        Next planned release is expected to come by Jan end.


    Regards,

    Anshu