Forums - Error: Layer Parameter Invalid

2 posts / 0 new
Last post
Error: Layer Parameter Invalid
zwave
Join Date: 18 Aug 17
Posts: 2
Posted: Fri, 2017-08-18 17:19

I'm getting an error (runtime warning) when I try to convert a simple caffe model to SNPE dlc.

Sample prototxt file

layer {

    type   : 'Input'
    name   : 'input_code'
    top    : 'input_code'
    input_param {
        shape {
            dim : 1
            dim : 1
            dim : 256
            dim : 256
        }
    }
}
 
layer {
    type   : 'Reshape'
    name   : '<reshape_1>'
    bottom : 'input_code'
    top    : '<top_layer>'
    reshape_param {
        shape {
           dim: 1
           dim: 1
           dim: 256
           dim: 256
        }
    }
}
command used to create dlc

snpe-caffe-to-dlc --caffe_txt test.prototxt --caffe_bin $test.caffemodel --dlc test.dlc

 

snpe-sdk/lib/python/snpe/snpe_caffe_to_dlc.py:1822: RuntimeWarning: error_code=802; error_message=Layer parameter value is invalid in GPU. Layer input_code_permute: output width * output depth (packed) = 16384 exceeds maximum image width 16384 for Adreno A530; error_component=GPU Runtime; line_no=269; thread_id=140415638374144

 

SNPE documentation (/snpe-sdk/doc/html/limitations.html) specifies the following:
  • Number of packed channels * width < MaxPerGPUSize

 

In our case, channel is 1 and width is 256. Therefore, 1 * 256 < 16384 (for A430, A530). However, I get the invalid error for GPU.

Could you please explain the issue with the example prototxt file?

Thanks!

 

  • Up0
  • Down0
oferr Moderator
Profile picture
Join Date: 26 Jul 17
Location: San Diego
Posts: 22
Posted: Mon, 2017-08-28 19:24

Thank you for checking Snapdragon NPE. 

Note that Snapdragon NPE uses tensor dimention order which is different than Caffe. We use (Height x Width x Channel), with channel being the fastest changing dimention. This is unlike Caffe, which uses (Channel x Height x Width), with width being the fastest chnaging channel. This is explained under "Input Data and Preprocessing -> Image Input Format". 

As result of the difference in dimentions handling, the reshape layer that you specify above is translated by the converter to a data permute layer of 256 x 256 dimentions - hence the violation of the GPU limitations.

This is visable if observing the DLC information, as generated by the dlc_info tool. Note the output dimentions of the data permute layer. 

----------------------------------------------------------------------------------------------------------------------------
| Id | Name         | Type    | Inputs               | Outputs              | Out Dims  | Parameters                       |
----------------------------------------------------------------------------------------------------------------------------
| 0  | data         | data    | data                 | data                 | 256x256x1 | input_preprocessing: passthrough |
| 1  | data_permute | permute | data                 | data.permute.reshape | 1x256x256 | permute_order: [2, 0, 1]         |
| 2  | reshape      | reshape | data.permute.reshape | reshape              | 1x256x256 |          

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.