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.

AM5729: TIDL model import error

Part Number: AM5729


I am currently working on applying transfer learning to ssdJacintoNetV2 using the Processor SDK Linux.  I have completed initial training, l1 regularization, and sparsification on this model.  I had set ssd_size=512x512 in train_image_object_detection.sh before training and all training completed successfully, except test and test_quantize, both of which threw a strange error about memory corruption due to double free.

I set up the environment with environment-setup.sh and ran tidl_model_import.out with a modified configuration file of 738x300 ssdJacintoNetV2.  However, when I run the model import tool, I get this error:

=============================== TIDL import - parsing ===============================

Caffe Network File : /home/ubuntu/caffe-jacinto-models/scripts/training/ti-custom-cfg1/JDetNet/20200128_00-56_ds_PSP_dsFac_32_hdDS8_1/sparse/ti-custom-cfg1_ssdJacintoNetV2_iter_120000.caffemodel  
Caffe Model File   : /home/ubuntu/caffe-jacinto-models/scripts/training/ti-custom-cfg1/JDetNet/20200128_00-56_ds_PSP_dsFac_32_hdDS8_1/sparse/deploy.prototxt  
TIDL Network File  : /home/ubuntu/tidl_net_jdetNet_ssd_512x512.bin  
TIDL Model File    : /home/ubuntu/tidl_param_jdetNet_ssd_512x512.bin  
Caffe import error: the input layer format is not supported. It must be in an input_shape construct as shown below:
input: "data"
input_shape {
  dim: 1
  dim: 3
  dim: 224
  dim: 224
}

I assume that 512x512 input size must be supported as it is an option in the train_image_object_detection.sh script located in caffe-jacinto-models/scripts. Why is it throwing this error and how do I fix it?

Thanks,
Kyle


  • Hi Kyle,

    Apologies your question was missed - we are looking into this now.

    Regards,
    Mike

  • Hi Michael,

    Any update on this issue? Apologies for the late reply, I went on vacation and just got back.

    Thanks,
    Kyle

  • Hi Kyle, no sure why you are getting this error. I have imported  JDetNet SSD 512x512 (voc0712_ssdJacintoNetV2_iter_104000.caffemodel) from https://github.com/tidsp/caffe-jacinto-models without issues. 

    No sure if you can give a try to this pre-trained models or if you can share yours for us to test it.

    thank you,

    Paula

  • Hi Paula,

    I followed the "standard" training procedure as per the software SDK instructions and still have all of my configs.  What files besides the topology/weight files and the config import files should I provide?

    I will try to import the provided JDetNet 512x512 model today and report back with the results.

    Thanks,

    Kyle

  • Paula,

    I have attached a zip archive containing my input config file, input net file, and input params file.  Please let me know if there is anything else you need to investigate this issue.

    Thanks,

    Kyle

    helloface-files.zip

  • Hi Kyle, I will take a look and come back to you in the next few days.

    thank you,

    Paula

  • Hi Kyle, I think I know what is the issue. In your TIDL import config file you mixed inputNetFile  with inputParamsFile =)

    Please try

    inputNetFile    = "/home/ubuntu/caffe-jacinto-models/scripts/training/ti-custom-cfg1/JDetNet/20200128_00-56_ds_PSP_dsFac_32_hdDS8_1/sparse/deploy.prototxt"

    inputParamsFile      = "/home/ubuntu/caffe-jacinto-models/scripts/training/ti-custom-cfg1/JDetNet/20200128_00-56_ds_PSP_dsFac_32_hdDS8_1/sparse/ti-custom-cfg1_ssdJacintoNetV2_iter_120000.caffemodel"

    This should fix the issue.

    thank you,

    Paula

  • Hi Paula, seems like my mistake was simple after all... Now the import works, but gives me an "Error in DetectionOutput layer: could not find parameters for detection_out!".  Is this critical or can I safely ignore it?  I will include my tidl_model_import.out command output below.  I have not added a sampleIn data file yet, so I don't expect the calibration to work right now.

    =============================== TIDL import - parsing ===============================
    
    Caffe Network File : /home/ubuntu/caffe-jacinto-models/scripts/training/ti-custom-cfg1/JDetNet/20200128_00-56_ds_PSP_dsFac_32_hdDS8_1/sparse/deploy.prototxt  
    Caffe Model File   : /home/ubuntu/caffe-jacinto-models/scripts/training/ti-custom-cfg1/JDetNet/20200128_00-56_ds_PSP_dsFac_32_hdDS8_1/sparse/ti-custom-cfg1_ssdJacintoNetV2_iter_120000.caffemodel  
    TIDL Network File  : /home/ubuntu/tidl_net_jdetNet_ssd_512x512.bin  
    TIDL Model File    : /home/ubuntu/tidl_param_jdetNet_ssd_512x512.bin  
    Name of the Network : ssdJacintoNetV2_deploy 
    Num Inputs :               1 
    
    Error in DetectionOutput layer: could not find parameters for detection_out!
     Num of Layer Detected :  57 
      0, TIDL_DataLayer                , data                                      0,  -1 ,  1 ,   x ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  0 ,       0 ,       0 ,       0 ,       0 ,       1 ,       3 ,     512 ,     512 ,         0 ,
      1, TIDL_BatchNormLayer           , data/bias                                 1,   1 ,  1 ,   0 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  1 ,       1 ,       3 ,     512 ,     512 ,       1 ,       3 ,     512 ,     512 ,    786432 ,
      2, TIDL_ConvolutionLayer         , conv1a                                    1,   1 ,  1 ,   1 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  2 ,       1 ,       3 ,     512 ,     512 ,       1 ,      32 ,     256 ,     256 , 157286400 ,
      3, TIDL_ConvolutionLayer         , conv1b                                    1,   1 ,  1 ,   2 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  3 ,       1 ,      32 ,     256 ,     256 ,       1 ,      32 ,     128 ,     128 , 150994944 ,
      4, TIDL_ConvolutionLayer         , res2a_branch2a                            1,   1 ,  1 ,   3 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  4 ,       1 ,      32 ,     128 ,     128 ,       1 ,      64 ,     128 ,     128 , 301989888 ,
      5, TIDL_ConvolutionLayer         , res2a_branch2b                            1,   1 ,  1 ,   4 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  5 ,       1 ,      64 ,     128 ,     128 ,       1 ,      64 ,      64 ,      64 , 150994944 ,
      6, TIDL_ConvolutionLayer         , res3a_branch2a                            1,   1 ,  1 ,   5 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  6 ,       1 ,      64 ,      64 ,      64 ,       1 ,     128 ,      64 ,      64 , 301989888 ,
      7, TIDL_ConvolutionLayer         , res3a_branch2b                            1,   1 ,  1 ,   6 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  7 ,       1 ,     128 ,      64 ,      64 ,       1 ,     128 ,      64 ,      64 , 150994944 ,
      8, TIDL_PoolingLayer             , pool3                                     1,   1 ,  1 ,   7 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  8 ,       1 ,     128 ,      64 ,      64 ,       1 ,     128 ,      32 ,      32 ,    524288 ,
      9, TIDL_ConvolutionLayer         , res4a_branch2a                            1,   1 ,  1 ,   8 ,  x ,  x ,  x ,  x ,  x ,  x ,  x ,  9 ,       1 ,     128 ,      32 ,      32 ,       1 ,     256 ,      32 ,      32 , 301989888 ,
     10, TIDL_ConvolutionLayer         , res4a_branch2b                            1,   1 ,  1 ,   9 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 10 ,       1 ,     256 ,      32 ,      32 ,       1 ,     256 ,      16 ,      16 , 150994944 ,
     11, TIDL_ConvolutionLayer         , res5a_branch2a                            1,   1 ,  1 ,  10 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 11 ,       1 ,     256 ,      16 ,      16 ,       1 ,     512 ,      16 ,      16 , 301989888 ,
     12, TIDL_ConvolutionLayer         , res5a_branch2b                            1,   1 ,  1 ,  11 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 12 ,       1 ,     512 ,      16 ,      16 ,       1 ,     512 ,      16 ,      16 , 150994944 ,
     13, TIDL_PoolingLayer             , pool6                                     1,   1 ,  1 ,  12 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 13 ,       1 ,     512 ,      16 ,      16 ,       1 ,     512 ,       8 ,       8 ,    131072 ,
     14, TIDL_PoolingLayer             , pool7                                     1,   1 ,  1 ,  13 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 14 ,       1 ,     512 ,       8 ,       8 ,       1 ,     512 ,       4 ,       4 ,     32768 ,
     15, TIDL_PoolingLayer             , pool8                                     1,   1 ,  1 ,  14 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 15 ,       1 ,     512 ,       4 ,       4 ,       1 ,     512 ,       2 ,       2 ,      8192 ,
     16, TIDL_PoolingLayer             , pool9                                     1,   1 ,  1 ,  15 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 16 ,       1 ,     512 ,       2 ,       2 ,       1 ,     512 ,       1 ,       1 ,      2048 ,
     17, TIDL_ConvolutionLayer         , ctx_output1                               1,   1 ,  1 ,   7 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 17 ,       1 ,     128 ,      64 ,      64 ,       1 ,     256 ,      64 ,      64 , 134217728 ,
     18, TIDL_ConvolutionLayer         , ctx_output2                               1,   1 ,  1 ,  12 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 18 ,       1 ,     512 ,      16 ,      16 ,       1 ,     256 ,      16 ,      16 ,  33554432 ,
     19, TIDL_ConvolutionLayer         , ctx_output3                               1,   1 ,  1 ,  13 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 19 ,       1 ,     512 ,       8 ,       8 ,       1 ,     256 ,       8 ,       8 ,   8388608 ,
     20, TIDL_ConvolutionLayer         , ctx_output4                               1,   1 ,  1 ,  14 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 20 ,       1 ,     512 ,       4 ,       4 ,       1 ,     256 ,       4 ,       4 ,   2097152 ,
     21, TIDL_ConvolutionLayer         , ctx_output5                               1,   1 ,  1 ,  15 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 21 ,       1 ,     512 ,       2 ,       2 ,       1 ,     256 ,       2 ,       2 ,    524288 ,
     22, TIDL_ConvolutionLayer         , ctx_output6                               1,   1 ,  1 ,  16 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 22 ,       1 ,     512 ,       1 ,       1 ,       1 ,     256 ,       1 ,       1 ,    131072 ,
     23, TIDL_ConvolutionLayer         , ctx_output1/relu_mbox_loc                 1,   1 ,  1 ,  17 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 23 ,       1 ,     256 ,      64 ,      64 ,       1 ,      16 ,      64 ,      64 ,  16777216 ,
     24, TIDL_FlattenLayer             , ctx_output1/relu_mbox_loc_perm            1,   1 ,  1 ,  23 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 24 ,       1 ,      16 ,      64 ,      64 ,       1 ,       1 ,       1 ,   65536 ,         1 ,
     25, TIDL_ConvolutionLayer         , ctx_output1/relu_mbox_conf                1,   1 ,  1 ,  17 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 25 ,       1 ,     256 ,      64 ,      64 ,       1 ,       8 ,      64 ,      64 ,   8388608 ,
     26, TIDL_FlattenLayer             , ctx_output1/relu_mbox_conf_perm           1,   1 ,  1 ,  25 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 26 ,       1 ,       8 ,      64 ,      64 ,       1 ,       1 ,       1 ,   32768 ,         1 ,
     28, TIDL_ConvolutionLayer         , ctx_output2/relu_mbox_loc                 1,   1 ,  1 ,  18 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 28 ,       1 ,     256 ,      16 ,      16 ,       1 ,      24 ,      16 ,      16 ,   1572864 ,
     29, TIDL_FlattenLayer             , ctx_output2/relu_mbox_loc_perm            1,   1 ,  1 ,  28 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 29 ,       1 ,      24 ,      16 ,      16 ,       1 ,       1 ,       1 ,    6144 ,         1 ,
     30, TIDL_ConvolutionLayer         , ctx_output2/relu_mbox_conf                1,   1 ,  1 ,  18 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 30 ,       1 ,     256 ,      16 ,      16 ,       1 ,      12 ,      16 ,      16 ,    786432 ,
     31, TIDL_FlattenLayer             , ctx_output2/relu_mbox_conf_perm           1,   1 ,  1 ,  30 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 31 ,       1 ,      12 ,      16 ,      16 ,       1 ,       1 ,       1 ,    3072 ,         1 ,
     33, TIDL_ConvolutionLayer         , ctx_output3/relu_mbox_loc                 1,   1 ,  1 ,  19 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 33 ,       1 ,     256 ,       8 ,       8 ,       1 ,      24 ,       8 ,       8 ,    393216 ,
     34, TIDL_FlattenLayer             , ctx_output3/relu_mbox_loc_perm            1,   1 ,  1 ,  33 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 34 ,       1 ,      24 ,       8 ,       8 ,       1 ,       1 ,       1 ,    1536 ,         1 ,
     35, TIDL_ConvolutionLayer         , ctx_output3/relu_mbox_conf                1,   1 ,  1 ,  19 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 35 ,       1 ,     256 ,       8 ,       8 ,       1 ,      12 ,       8 ,       8 ,    196608 ,
     36, TIDL_FlattenLayer             , ctx_output3/relu_mbox_conf_perm           1,   1 ,  1 ,  35 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 36 ,       1 ,      12 ,       8 ,       8 ,       1 ,       1 ,       1 ,     768 ,         1 ,
     38, TIDL_ConvolutionLayer         , ctx_output4/relu_mbox_loc                 1,   1 ,  1 ,  20 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 38 ,       1 ,     256 ,       4 ,       4 ,       1 ,      24 ,       4 ,       4 ,     98304 ,
     39, TIDL_FlattenLayer             , ctx_output4/relu_mbox_loc_perm            1,   1 ,  1 ,  38 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 39 ,       1 ,      24 ,       4 ,       4 ,       1 ,       1 ,       1 ,     384 ,         1 ,
     40, TIDL_ConvolutionLayer         , ctx_output4/relu_mbox_conf                1,   1 ,  1 ,  20 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 40 ,       1 ,     256 ,       4 ,       4 ,       1 ,      12 ,       4 ,       4 ,     49152 ,
     41, TIDL_FlattenLayer             , ctx_output4/relu_mbox_conf_perm           1,   1 ,  1 ,  40 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 41 ,       1 ,      12 ,       4 ,       4 ,       1 ,       1 ,       1 ,     192 ,         1 ,
     43, TIDL_ConvolutionLayer         , ctx_output5/relu_mbox_loc                 1,   1 ,  1 ,  21 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 43 ,       1 ,     256 ,       2 ,       2 ,       1 ,      16 ,       2 ,       2 ,     16384 ,
     44, TIDL_FlattenLayer             , ctx_output5/relu_mbox_loc_perm            1,   1 ,  1 ,  43 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 44 ,       1 ,      16 ,       2 ,       2 ,       1 ,       1 ,       1 ,      64 ,         1 ,
     45, TIDL_ConvolutionLayer         , ctx_output5/relu_mbox_conf                1,   1 ,  1 ,  21 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 45 ,       1 ,     256 ,       2 ,       2 ,       1 ,       8 ,       2 ,       2 ,      8192 ,
     46, TIDL_FlattenLayer             , ctx_output5/relu_mbox_conf_perm           1,   1 ,  1 ,  45 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 46 ,       1 ,       8 ,       2 ,       2 ,       1 ,       1 ,       1 ,      32 ,         1 ,
     48, TIDL_ConvolutionLayer         , ctx_output6/relu_mbox_loc                 1,   1 ,  1 ,  22 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 48 ,       1 ,     256 ,       1 ,       1 ,       1 ,      16 ,       1 ,       1 ,      4096 ,
     49, TIDL_FlattenLayer             , ctx_output6/relu_mbox_loc_perm            1,   1 ,  1 ,  48 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 49 ,       1 ,      16 ,       1 ,       1 ,       1 ,       1 ,       1 ,      16 ,         1 ,
     50, TIDL_ConvolutionLayer         , ctx_output6/relu_mbox_conf                1,   1 ,  1 ,  22 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 50 ,       1 ,     256 ,       1 ,       1 ,       1 ,       8 ,       1 ,       1 ,      2048 ,
     51, TIDL_FlattenLayer             , ctx_output6/relu_mbox_conf_perm           2,   1 ,  1 ,  50 ,  x ,  x ,  x ,  x ,  x ,  x ,  x , 51 ,       1 ,       8 ,       1 ,       1 ,       1 ,       1 ,       1 ,       8 ,         1 ,
     53, TIDL_ConcatLayer              , mbox_loc                                  0,   6 ,  1 ,  24 , 29 , 34 , 39 , 44 , 49 ,  x ,  x , 53 ,       1 ,       1 ,       1 ,   65536 ,       1 ,       1 ,       1 ,   73680 ,         1 ,
     54, TIDL_ConcatLayer              , mbox_conf                                 1,   6 ,  1 ,  26 , 31 , 36 , 41 , 46 , 51 ,  x ,  x , 54 ,       1 ,       1 ,       1 ,   32768 ,       1 ,       1 ,       1 ,   36840 ,         1 ,
     56, TIDL_DetectionOutputLayer     , detection_out                             1,   2 ,  1 ,  53 , 54 ,  x ,  x ,  x ,  x ,  x ,  x , 56 ,       1 ,       1 ,       1 ,   73680 ,       1 ,       1 ,       1 ,    5600 ,         1 ,
    Total Giga Macs : 2.3289
    
    =============================== TIDL import - calibration ===============================
    
    Couldn't open sampleInData file:   
    

    Thanks,

    Kyle

  • Hi Kyle, I think it is safe to ignore.. we would need to dig a little bit more on the message, but as a quick test I re-import pre-trained JDetNet from GitHub caffe-jacinto-models and I am getting the same message.

    thank you,

    Paula

  • Hi Paula,

    Everything seems to work! I added a sampleInFile and calibration results were as expected.  Now to leverage TIDL API :)

    Thanks,

    Kyle

  • Kyle, great! thanks for let us know

    Paula