Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pradnya720 opened this issue Jul 30, 2024 · 1 comment
Labels
question Further information is requested

Comments

@pradnya720
Copy link

pradnya720 commented Jul 30, 2024

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:

  • Operating System: Ubuntu 20.04
  • Compiler: GNU 9.4.0
  • MNN Version: 2.9
  • Model: ResNet50 (converted from PyTorch)
  • Build Type: Release

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:

  • I have ensured that the model conversion was completed successfully without errors.
  • I have verified that the input data format and types are correct and consistent with the model requirements.

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
Copy link
Collaborator

jxt1234 commented Aug 7, 2024

What's your code for MNN_Inference_run ?

@jxt1234 jxt1234 added the question Further information is requested label Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants