Forums - NPE failed to run image-classifier

1 post / 0 new
NPE failed to run image-classifier
xuyuanli
Join Date: 7 Jul 21
Posts: 1
Posted: Sun, 2021-07-18 20:36

I follow Qualcomm Neural Processing Engine official tutorial to build the Android sample app. I used caffe and converted dlc to example image classifier, build network seems no problem, then I click an image to classify, there is error like this

07-19 09:54:41.307 13708 13855 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #2
07-19 09:54:41.307 13708 13855 E AndroidRuntime: Process: com.qualcomm.qti.snpe.imageclassifiers, PID: 13708
07-19 09:54:41.307 13708 13855 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at android.os.AsyncTask$4.done(AsyncTask.java:399)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:271)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:289)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.lang.Thread.run(Thread.java:919)
07-19 09:54:41.307 13708 13855 E AndroidRuntime: Caused by: java.nio.BufferUnderflowException
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.nio.Buffer.nextGetIndex(Buffer.java:515)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.nio.ByteBufferAsFloatBuffer.get(ByteBufferAsFloatBuffer.java:92)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at com.qualcomm.qti.snpe.imageclassifiers.tasks.AbstractClassifyImageTask.preProcess(AbstractClassifyImageTask.java:202)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at com.qualcomm.qti.snpe.imageclassifiers.tasks.AbstractClassifyImageTask.extractColorChannels(AbstractClassifyImageTask.java:186)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at com.qualcomm.qti.snpe.imageclassifiers.tasks.AbstractClassifyImageTask.loadRgbBitmapAsFloat(AbstractClassifyImageTask.java:115)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at com.qualcomm.qti.snpe.imageclassifiers.tasks.ClassifyImageWithFloatTensorTask.doInBackground(ClassifyImageWithFloatTensorTask.java:45)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at com.qualcomm.qti.snpe.imageclassifiers.tasks.ClassifyImageWithFloatTensorTask.doInBackground(ClassifyImageWithFloatTensorTask.java:23)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at android.os.AsyncTask$3.call(AsyncTask.java:378)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
07-19 09:54:41.307 13708 13855 E AndroidRuntime:     ... 4 more

What's wrong about this ?How can I solve this problem?

Thank  you in advance.

  • Up0
  • Down0

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.