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 during MNN Model export #319

Open
MarcoMultichannel opened this issue May 13, 2024 · 5 comments
Open

Segmentation fault during MNN Model export #319

MarcoMultichannel opened this issue May 13, 2024 · 5 comments
Assignees
Labels
good first issue Good for newcomers

Comments

@MarcoMultichannel
Copy link

I get a "segmentation fault" when I try to convert the ONNX model in MNN model:

MNNConvert -f ONNX --modelFile voxceleb_resnet34.onnx --MNNModel model.mnn --bizCode MNN
The device support i8sdot:0, support fp16:0, support i8mm: 0
Start to Convert Other Model Format To MNN Model..., target version: 2.8
[13:09:33] /home/user/MNN-976d1d7c0f916ea8a7acc3d31352789590f00b18/tools/converter/source/onnx/onnxConverter.cpp:46: ONNX Model ir version: 7
[13:09:33] /home/user/MNN-976d1d7c0f916ea8a7acc3d31352789590f00b18/tools/converter/source/onnx/onnxConverter.cpp:47: ONNX Model opset version: 14
Start to Optimize the MNN Net...
Segmentation fault

It happens both with and without --saveStaticModel.
The model used is the pretrained model available, but I tried exporting a model using the updated export_onnx.py script and the problem persists.
The MNN version and flags are the same as defined in the CMakeFiles.txt.

@JiJiJiang
Copy link
Collaborator

@cdliang11 Pls follow this.

@cdliang11 cdliang11 self-assigned this May 14, 2024
@cdliang11
Copy link
Collaborator

mnn version:

MNN    2.8.3

Try exporting the model using export_mnn.py.

@MarcoMultichannel
Copy link
Author

Still segmentation fault.
If I try to export the model using export_mnn.py it doesn't find the executable "MNNConvert", since it calls MNNConvert using os.system.

How can I compile MNN to recreate the same environment of the test? I'm starting to think that I'm not compiling it properly.

@cdliang11
Copy link
Collaborator

Still segmentation fault. If I try to export the model using export_mnn.py it doesn't find the executable "MNNConvert", since it calls MNNConvert using os.system.

How can I compile MNN to recreate the same environment of the test? I'm starting to think that I'm not compiling it properly.

try: pip install MNN

@MarcoMultichannel
Copy link
Author

I managed to convert the model without a segmentation fault happening.
I installed mnn with pip install MNN as you said and then instead of using MMNConvert I executed the python version:

python -m mnnconvert -f ONNX --modelFile model.onnx --MNNModel model.mnn --bizCode MNN

@cdliang11 cdliang11 added the good first issue Good for newcomers label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants