alibaba / MNN

MNN is a blazing fast, lightweight deep learning framework, battle-tested by business-critical use cases in Alibaba
http://www.mnn.zone/
8.69k stars 1.66k forks source link

Segmentation fault while performing inference with a ResNet50 model that I converted from PyTorch to MNN #2978

Closed pradnya720 closed 3 weeks ago

pradnya720 commented 3 months ago

I am experiencing a segmentation fault while performing inference with a ResNet50 model that I converted from PyTorch to MNN. The issue occurs during the inference stage after converting the model and building the MNN Inference executable. The segmentation fault is consistently triggered when running the MNN_Inference_run executable with the converted model.

Environment:

Steps to Reproduce:

  1. Convert the ResNet50 model from PyTorch to MNN using the provided conversion tool.
  2. Build the MNN Inference executable from the source.
  3. Run the inference executable with the converted model using the command:
    ./MNN_Inference_run $MNN_MODEL

Observed Behavior:

During inference, the following output is generated before the segmentation fault occurs:

CPU Group: [ 20  21  31  23  25  17  27  19  29  30  22  28  24  18  16  26 ], 800000 - 4300000
CPU Group: [ 14  6  13  1  15  3  4  5  2  7  12  0 ], 800000 - 5500000
CPU Group: [ 10  11  9  8 ], 800000 - 5800000
The device supports: i8sdot:0, fp16:0, i8mm: 0, sve2: 0
===> compute shape: input.21___tr4input0.1, [ConvertTensor]

        Inputs:

        ptr=0x5571367b9a10, format=NCHW, datatype=2;            *Scalar*

        Outputs:

        ptr=:0x5571367ba350, format=NC4HW4, datatype=2;         *Scalar*

COMPUTEE ERROR 2.....

COMPUTEE ERROR 1.....

===> compute shape: input0.1, [Convolution]

        Inputs:

        ptr=0x5571367ba350, format=NC4HW4, datatype=2;          *Scalar*

        Outputs:

        ptr=:0x5571367c5bf0, format=NCHW, datatype=2;   0, 0, 0, 0, 

Session Info: memory use 0.000000 MB, flops is 0.000000 M, backendType is 13, batch size = 1

./mnnConvert.sh: line 40: 1488563 Segmentation fault      ./MNN_Inference_run $MNN_MODEL

Expected Behavior:

The model should perform inference without encountering segmentation faults.

Logs:

Logs are included in the output above. Please find additional logs attached if necessary.

Additional Information:

Request:

Could you please investigate this issue and provide guidance on how to resolve the segmentation fault? If additional information or logs are needed, I am happy to provide them.

Thank you for your assistance!


jxt1234 commented 2 months ago

What's your code for MNN_Inference_run ?

github-actions[bot] commented 3 weeks ago

Marking as stale. No activity in 60 days.