Forums - snpe cannot work with dlc modle converted from tensorflow

7 posts / 0 new
Last post
snpe cannot work with dlc modle converted from tensorflow
liuxz6271
Join Date: 24 May 16
Posts: 5
Posted: Thu, 2018-03-22 23:41
Dear SNPE developers,
 
    I converted the tensorflow model  ssd_mobilenet_v1_coco_2017_11_17.tar.gz to dlc, then run in  android os.
 
when classify the first image,  output error msg1, then get the wrong result, then classify the next image,  output error msg2, and the app crash.
 
could u help me to fix this.
 
[error msg1]
 
03-23 05:45:47.566  8904  8935 W art     : ae339000-ae33a000 r--p 00000000 00:00 0          [anon:atexit handlers]
03-23 05:45:47.566  8904  8935 W art     : ae33a000-ae33b000 ---p 00000000 00:00 0          [anon:thread signal stack guard page]
03-23 05:45:47.566  8904  8935 W art     : ae33b000-ae33d000 rw-p 00000000 00:00 0          [anon:thread signal stack]
03-23 05:45:47.566  8904  8935 W art     : ae33d000-ae33e000 r-xp 00000000 00:00 0          [sigpage]
03-23 05:45:47.567  8904  8935 W art     : ae33e000-ae39d000 r-xp 00000000 103:09 382       /system/bin/linker
03-23 05:45:47.567  8904  8935 W art     : ae39d000-ae39f000 r--p 0005e000 103:09 382       /system/bin/linker
03-23 05:45:47.567  8904  8935 W art     : ae39f000-ae3a0000 rw-p 00060000 103:09 382       /system/bin/linker
03-23 05:45:47.567  8904  8935 W art     : ae3a0000-ae3a2000 rw-p 00000000 00:00 0 
03-23 05:45:47.567  8904  8935 W art     : ae3a2000-ae3a3000 r--p 00000000 00:00 0 
03-23 05:45:47.567  8904  8935 W art     : ae3a3000-ae3a5000 rw-p 00000000 00:00 0 
03-23 05:45:47.567  8904  8935 W art     : ae3a5000-ae3aa000 r-xp 00000000 103:09 262       /system/bin/app_process32
03-23 05:45:47.568  8904  8935 W art     : ae3aa000-ae3ab000 r--p 00004000 103:09 262       /system/bin/app_process32
03-23 05:45:47.568  8904  8935 W art     : ae3ab000-ae3ac000 rw-p 00000000 00:00 0 
03-23 05:45:47.568  8904  8935 W art     : ae400000-b8400000 rw-p 00000000 00:00 0          [heap]
03-23 05:45:47.568  8904  8935 W art     : be5ac000-be5ac000 ---p 00000000 00:00 0 
03-23 05:45:47.569  8904  8935 W art     : be5ac000-bedab000 rw-p 00000000 00:00 0          [stack]
03-23 05:45:47.569  8904  8935 W art     : ffff0000-ffff1000 r-xp 00000000 00:00 0          [vectors]
03-23 05:45:47.569  8904  8935 W art     : 
03-23 05:45:47.570  8904  8935 W art     : Large object allocation failed: Failed anonymous mmap(0x0, 134946816, 0x3, 0x2, 36, 0): Out of memory. See process maps in the log.
03-23 05:45:47.570  8904  8935 W art     : Throwing OutOfMemoryError "Failed to allocate a 134944906 byte allocation with 7402280 free bytes and 501MB until OOM"
03-23 05:45:47.761  8904  8915 I art     : Background sticky concurrent mark sweep GC freed 4(440B) AllocSpace objects, 0(0B) LOS objects, 0% free, 139MB/139MB, paused 1.137ms total 186.698ms
 
 
 
 
[error msg2]
 
03-23 05:59:48.413  8904  9632 F libc    : /local/mnt2/workspace2/varulesa/aosp/ndk_match/out/build/tmp/build-16404/build-libc++/ndk/sources/cxx-stl/llvm-libc++/../llvm-libc++abi/libcxxabi/src/abort_message.cpp:74: void abort_message(const char *, ...): assertion "terminating with uncaught exception of type std::bad_alloc: std::bad_alloc" failed
 
03-23 05:59:48.413  8904  9632 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 9632 (AsyncTask #4)
03-23 05:59:48.414   258   258 W         : debuggerd: handling request: pid=8904 uid=10214 gid=10214 tid=9632
03-23 05:59:48.526  9639  9639 F DEBUG   : pid: 8904, tid: 9632, name: AsyncTask #4  >>> com.qualcomm.qti.snpe.imageclassifiers <<<
03-23 05:59:49.724   258   258 W         : debuggerd: resuming target 8904
03-23 05:59:49.951   391   391 I Zygote  : Process 8904 exited due to signal (6)
 
Thanks
BRs
  • Up0
  • Down0
demo-name
Join Date: 26 Jan 18
Posts: 8
Posted: Fri, 2018-03-23 07:36

Hi,

I ran into the out of memory error when developing an app separate from the example as well. It was resolved by adding:

android:largeHeap="true"

to the manifest in the <application> section.

Have you been able to get all the outputs from the model? I can run it but only  get detection_classes as output. I do not see the scores or boxes without enabling debug option which drastically slows down performance.

Good luck!

  • Up0
  • Down0
jesliger
Join Date: 6 Aug 13
Posts: 75
Posted: Fri, 2018-03-23 09:48

To get all the outputs you have to call setOutputLayers() in the builder and give the specific names of outputs you want. I believe it's mentioned in another thread or two on this forum.  Also documented is what line to put into your image_list.txt to get snpe-net-run to output those other outputs as well.

  • Up0
  • Down0
demo-name
Join Date: 26 Jan 18
Posts: 8
Posted: Mon, 2018-03-26 07:40

That worked, thank you!

  • Up0
  • Down0
liuxz6271
Join Date: 24 May 16
Posts: 5
Posted: Mon, 2018-03-26 20:57

Hi

   I have set    android:largeHeap="true" , and run with  snpe is 1.13.0.0 on nexus p6.

    I can get the following output。

    “detection_classes:0”

    “Postprocessor/BatchMultiClassNonMaxSuppression_classes”

    ”Postprocessor/BatchMultiClassNonMaxSuppression_boxes“

    “Postprocessor/BatchMultiClassNonMaxSuppression_scores”

 


thanks.

 

  • Up0
  • Down0
madhavajay
Join Date: 15 Mar 18
Posts: 22
Posted: Sun, 2018-04-29 17:24

Did anyone here successfully decode the output?

I get garbage!

Result = {ArrayList@5092}  size = 50
 0 = {Classifier$Recognition@5205} "[0] sports ball (4.4%) RectF(28.137482, 119.56744, 283.36014, 298.3802)"
 1 = {Classifier$Recognition@5206} "[1] sports ball (4.1%) RectF(128.9198, 66.366425, 287.69986, 251.92664)"
 2 = {Classifier$Recognition@5207} "[2] sports ball (4.1%) RectF(115.56224, 13.20836, 291.68512, 170.67203)"
 3 = {Classifier$Recognition@5208} "[3] sports ball (3.9%) RectF(57.43878, 13.773882, 263.34735, 157.36337)"
 4 = {Classifier$Recognition@5209} "[4] sports ball (3.7%) RectF(163.60475, 41.56569, 268.53174, 269.78842)"
 5 = {Classifier$Recognition@5210} "[5] sports ball (3.7%) RectF(156.57309, 6.4187875, 270.69257, 207.89496)"
 6 = {Classifier$Recognition@5211} "[6] sports ball (3.4%) RectF(46.86135, 148.17146, 206.738, 300.0)"
 7 = {Classifier$Recognition@5212} "[7] sports ball (3.1%) RectF(39.446228, 191.30995, 215.80078, 266.1879)"
 8 = {Classifier$Recognition@5213} "[8] sports ball (3.0%) RectF(89.45885, 89.07802, 297.30853, 218.85495)"
 9 = {Classifier$Recognition@5214} "[9] sports ball (3.0%) RectF(116.71162, 145.27698, 280.3793, 300.0)"
 10 = {Classifier$Recognition@5215} "[10] sports ball (3.0%) RectF(6.7646413, 163.43538, 300.0, 278.81375)"
 
More here:
  • Up0
  • Down0
demo-name
Join Date: 26 Jan 18
Posts: 8
Posted: Mon, 2018-04-30 06:30

I responed in your other thread, good luck!

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