Forums - SNPE execute is crashed with input image as black

2 posts / 0 new
Last post
SNPE execute is crashed with input image as black
nguyennhatanh1805
Join Date: 8 Sep 22
Posts: 2
Posted: Wed, 2022-09-28 22:04

Dear all,

I'm using SNPE to deligate network on DSP of my android phone, without root device

I have tested DSP with follow https://developer.qualcomm.com/sites/default/files/docs/snpe/tools.html#... and results is passed

I'm facing an issue that when I input a black image into network, It will be crashed
 with running on Android studio Debuging, It pointed out that crash come from function 

error crash reported from app is memory access error: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)

 

in SNPE.hpp

bool execute(const zdl::DlSystem::ITensor *input, zdl::DlSystem::TensorMap &output) noexcept;

in my wrapper call

void NNDLC::executeNetwork(std::map<std::string, std::vector<float>> &result) {

    zdl::DlSystem::TensorMap outputTensorMap;
    snpe->execute(inputTensor.get(), outputTensorMap); ////////////////=> crashing point to this line

    zdl::DlSystem::StringList tensorNames = outputTensorMap.getTensorNames();

    std::for_each( tensorNames.begin(), tensorNames.end(), [&](const char* name)
    {
        auto tensorPtr = outputTensorMap.getTensor(name);
        size_t size = tensorPtr->getSize();
        result[name].reserve(size);
        std::copy (tensorPtr->begin(), tensorPtr->end() ,std::back_inserter(result[name]));
    });

also if I run app with Cameramode, It will work normally but if I hide the camera, Crashing come and point to same function above
I have tested on 3 kind of device and below is behavior, It make me so confusing and dont know why it happen:

 
Scenario Samsung A23(Android 12 - SnapD 665) Redmi note 11(Android 11 - SnapD 665) Redme Note 10 Pro(Android 12 - SnapD 732G)
1.CameraMode: Starting app with normal view => App crashing No No No
2.CameraMode: Starting app with hidden camera => App crashing Yes Yes No
3.CameraMode: Starting app with normal view then hidden camera => App crashing Yes Sometimes No
4.CameraMode: Starting app with normal view then hidden camera 
then un-hidden camera, repeat several times => App crashing crashed on first time Sometimes No
5.image mode: Starting app with input is black image => App crashing Yes Yes Yes
 

Delegate network on CPU is working fine for all cases except last one(input black image frame)

Could someone englighten me what issue there?

  • Up0
  • Down0
nguyennhatanh1805
Join Date: 8 Sep 22
Posts: 2
Posted: Fri, 2022-09-30 01:36

Is there anyone meet the same issue or know the reason why above issue occur?
please help to verify

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