Forums - Tensorflow example code

6 posts / 0 new
Last post
Tensorflow example code
dongsung.kim
Join Date: 11 Jan 16
Posts: 1
Posted: Tue, 2017-07-25 08:56

Hello

Quick question

1. Do you have any tensorflow (inception v3) example not caffe one?

2. Tensorflow uses CPU only ? or can we use GPU or DSP can used for the inference?

  • Up0
  • Down0
haijunz0
Join Date: 24 Jul 17
Posts: 1
Posted: Tue, 2017-07-25 16:05

1.  Yes, please  refer to:

    ├── alexnet

│   ├── data
│   │   ├── chairs.jpg
│   │   ├── handicap_sign.jpg
│   │   ├── notice_sign.jpg
│   │   ├── plastic_cup.jpg
│   │   └── trash_bin.jpg
│   └── scripts
│       ├── create_alexnet_raws.py
│       ├── create_file_list.py
│       ├── setup_alexnet.py
│       └── show_alexnet_classifications.py
├── inception_v3
│   └── scripts
│       ├── create_file_list.py
│       ├── create_inceptionv3_raws.py
│       ├── setup_inceptionv3.py
│       └── show_inceptionv3_classifications.py
 
 
2.   Tensorflow/caffe models first need convert to DLC format , SNPE use DLC format to run on CPU,GPU,DSP which developer can assign.
 
 
Thanks,
Haijun
  • Up0
  • Down0
moljaca moderator
Join Date: 25 Jul 17
Location: San Diego
Posts: 40
Posted: Tue, 2017-07-25 17:00

Both questions are answered in our full SDK documentation, which can be found in the "doc/html" folder of the SDK. If the documentation does not fully address your question, please ask a new question. 

Q1: There is tutorial on how to run Tensorflow Inception v3 model. Please refer to Example Tutorials in SDK documentation: .../doc/html/tutorial_inceptionv3.html

Q2.  As haijunz0 posted, you need to convert Tensorflow model to DLC format which Snapdragon NPE can load. You can load and run converted model on CPU, GPU, or DSP. You select which target through Snapdragon NPE API.

 

  • Up0
  • Down0
lykaios1203
Join Date: 21 Sep 17
Posts: 1
Posted: Tue, 2017-10-31 20:09

Hi moljaca,

Example shows how to use setup_models.sh to prepare caffe's model and data for APP.

Will qualcomm provide another APP and setup_models.sh for Tensorflow's model and data?

or any doc is recommanded to read about changing caffe's exmaple to tensorflow?

Thank you,

Colin

  • Up0
  • Down0
Starlitsky2010
Join Date: 13 Jan 18
Posts: 7
Posted: Tue, 2018-01-16 04:09

Hi, moljaca

~/snpe-sdk/examples/android/image-classifiers/setup_models.sh shows how to pack an alexnet dlc to a zip file.

Is mean_image.bin necessary for inception_v3?

And I've modified the script setup_models.sh for inception_v3, is it OK?

mkdir -p inception_v3
mkdir -p inception_v3/images

cd inception_v3

cp -R ../../../../models/inception_v3/data/cropped/*.jpg images
cp -R ../../../../models/inception_v3/dlc/inception_v3.dlc model.dlc
cp -R ../../../../models/inception_v3/data/imagenet_comp_graph_label_strings.txt labels.txt
#cp -R ../../../../models/inception_v3/data/ilsvrc_2012_mean_cropped.bin mean_image.bin

zip -r inception_v3.zip ./*
mkdir ../app/src/main/res/raw/
cp inception_v3.zip ../app/src/main/res/raw/

cd ..
rm -rf ./inception_v3
 

Thanks and waiting for your kind reply.

 

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Tue, 2018-01-16 04:34

A mean image is not required for inception V3. 

See: https://developer.qualcomm.com/forum/qdn-forums/software/snapdragon-neur...

  • 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.