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 : 1dim : 1dim : 256dim : 256}}}layer {type : 'Reshape'name : '<reshape_1>'bottom : 'input_code'top : '<top_layer>'reshape_param {shape {dim: 1dim: 1dim: 256dim: 256}}}command used to create dlcsnpe-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
- 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!
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 |