Forums - SNPE with Caffe2

4 posts / 0 new
Last post
SNPE with Caffe2
desaipratik
Join Date: 25 Jul 17
Posts: 3
Posted: Fri, 2017-08-11 02:06

Hello,

 

Since SNPE supports Caffe2 also, how to convert caffe2 .pb models to .dlc snpe models and while building an app how to use caffe2 environment?

Your help would be appreciated.

 

Best regards,

Pratik

  • Up0
  • Down0
mit2nil
Join Date: 6 Nov 16
Posts: 1
Posted: Fri, 2017-08-25 11:27

I think they have provided instructions on caffe2 to dlc conversion in the sdk documentation.

<sdk>/doc/html/model_conv_caffe.html

I am no expert but I think once you have dlc model, you should be able to follow android tutorial in sdk, <sdk>/doc/html/android_tutorial.html assuming you are interested in android app.

  • Up0
  • Down0
moljaca moderator
Join Date: 25 Jul 17
Location: San Diego
Posts: 40
Posted: Fri, 2017-08-25 12:58

Thank you mit2nil. Correct. The SDK documentation explains the process of converting caffe2 to dlc. Need to use snpe-caffe2-to-dlc tool which is provided in SDK.

  • Up0
  • Down0
gesqdn-forum
Join Date: 4 Nov 18
Posts: 184
Posted: Tue, 2019-04-02 06:32

Before model conversion, you must have to setup caffe2 on your system. Once you have setup the caffe2 on the system, intialize the enviromental variable for caffe2 using  below command:

SNPE_ROOT$ source bin/envsetup.sh -f $CAFFE2_DIR 

where $CAFFE2_DIR is the path to the Caffe2 installation.


once you initialized with caffe2 enviromental variable use the below command to convert your caffe2 model into dlc file.

$ snpe-caffe2-to-dlc --predict_net <predict_net pb file> --exec_net <exec_net pb file> --input_dim <input_layer_name> <input_shape> --dlc <output file name for converted dlc(filename.dlc)>
  • 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.