TFLite Model Conversion

Machine Learning frameworks have specific formats for storing neural network models. Qualcomm® Neural Processing SDK supports these various models by converting them to a framework neutral deep learning container (DLC) format. The DLC file is used by the Qualcomm® Neural Processing SDK runtime for execution of the neural network.

A trained Tensorflow model can be converted to a TFLte model (.tflite) file using the instructions at https://www.tensorflow.org/lite/convert#python_api_

The snpe-tflite-to-dlc tool converts a TFLite model into an equivalent Qualcomm® Neural Processing SDK DLC file. The following command will convert an Inception v3 TFLite model into a Qualcomm® Neural Processing SDK DLC file.

snpe-tflite-to-dlc --input_network inception_v3.tflite
                   --input_dim input "1,299,299,3"
                   --output_path inception_v3.dlc

The Inception v3 model files can be obtained from https://tfhub.dev/tensorflow/lite-model/inception_v3/1/default/1

Note:

  • To check the list of currently supported TFlite Ops, see Op Support Table.

  • Qualcomm® Neural Processing SDK and TFlite Converter currently only support float input data types.

  • There are some known issues with certain older versions of MLIR based TFLite converter that can lead to failure loading the model.