Forums - Onnx to dlc conversion adds permute layers

1 post / 0 new
Onnx to dlc conversion adds permute layers
gjoasen
Join Date: 23 Jun 21
Posts: 1
Posted: Wed, 2021-06-23 05:14

Hi
I have got an onnx model where the input to my network is of size 1x192x256x3. This model is converted to dlc format using the snpe-onnx-to-dlc tool (v 1.51.0.2663). The conversion completes successfully, but when I look at the resulting dlc model the first layers are as follows:

|--------------------------------------------------------------------------------------------------|
| Id | Name    | Type    | Inputs  | Outputs    | Out Dims     | Parameters                 |
|--------------------------------------------------------------------------------------------------|
| 0  | input:0  | data        | input:0  | input:0  | 1x256x3x192  | input_preprocessing: passthrough  |
|     |             |               |              |             |                      | input_type: default                        |
| 1   | layer-1   | permute  | input:0  | layer-1   | 1x192x256x3  | permute_order: [0, 3, 1, 2]               |
|     |             |               |              |             |                     | MACs per inference: 589k (0.139%)  |
| 2   | layer-2  | permute  | layer-1   | layer2   | 1x3x192x256  | permute_order: [0, 3, 1, 2]               |
|     |             |               |              |             |                      | MACs per inference: 589k (0.139%) |
| 3  | layer-3  | permute  | layer-2   | layer-3  | 1x192x256x3  | permute_order: [0, 2, 3, 1]  
So the input dimension is now 1x256x3x192. Then there are three permute layers that to me seem superfluous. The output of the 3rd permute layer is 1x192x256x3, which is exactly the input dimension of my onnx model. How can I get my dlc file to have input dims 1x192x256x3 and get rid of these permute layers?
  • Up0
  • Down0

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.