Snapdragon Neural Processing Engine SDK
Reference Guide
ONNX Model Conversion

Machine Learning frameworks have specific formats for storing neural network models. SNPE supports these various models by converting them to a framework neutral deep learning container (DLC) format. The DLC file is used by the SNPE runtime for execution of the neural network. SNPE includes a tool, "snpe-onnx-to-dlc", for converting models serialized in the ONNX format to DLC.

Converting Models from ONNX to DLC

The snpe-onnx-to-dlc tool converts a serialized ONNX model to an equivalent DLC representation.

With the ONNX alexnet model obtained by following the instructions in https://github.com/onnx/models/tree/master/bvlc_alexnet/README.md, the following command will produce a DLC representation of alexnet:

snpe-onnx-to-dlc --input_network models/bvlc_alexnet/bvlc_alexnet/model.onnx
                 --output_path bvlc_alexnet.dlc

Support Notes

Information about the ops, versions, and parameters SNPE supports can be found at Supported ONNX Ops.

Neither snpe-onnx-to-dlc nor the SNPE runtime support symbolic tensor shape variables. See Network Resizing for information on resizing SNPE networks at initialization.

In general, SNPE determines the data types for tensors and operations based upon the needs of the runtime and builder parameters. Data types specified by the ONNX model will usually be ignored.