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

ONNX转MNN出现错误 #3132

Open
12314312 opened this issue Dec 20, 2024 · 1 comment
Open

ONNX转MNN出现错误 #3132

12314312 opened this issue Dec 20, 2024 · 1 comment
Labels
question Further information is requested

Comments

@12314312
Copy link

将ONNX转换成MNN
运行的代码:/workspace/MNN/tools/script# python testMNNFromOnnx.py /workspace/onnxfile/SeaFormer_T_bs32_36.5.onnx
Dir exist
onnx/test.onnx
tensor(float)
['output']
inputs:
input
onnx/
outputs:
onnx/output.txt (1, 1, 512, 512)
onnx/
The device supports: i8sdot:0, fp16:0, i8mm: 0, sve2: 0
Start to Convert Other Model Format To MNN Model..., target version: 2.9
[07:01:53] /workspace/MNN/tools/converter/source/onnx/onnxConverter.cpp:46: ONNX Model ir version: 6
[07:01:53] /workspace/MNN/tools/converter/source/onnx/onnxConverter.cpp:47: ONNX Model opset version: 11
Start to Optimize the MNN Net...
inputTensors : [ input, ]
outputTensors: [ output, ]
Converted Success!
Check convert result by onnx, thredhold is 0.01
input
output: output
output: (1, 1, 512, 512, )
TESTERROR output value error : absMaxV:13.000000 - DiffMax 11.000000
Error for output output
Save mnn result to .error director

出现错误。用DEBUG

Test Node : Div_730 True
onnx/test.onnx
tensor(float)
['1482']
inputs:
input
onnx/
outputs:
onnx/1482.txt (1, 512, 512)
onnx/
The device supports: i8sdot:0, fp16:0, i8mm: 0, sve2: 0
Start to Convert Other Model Format To MNN Model..., target version: 2.9
[07:06:41] /workspace/MNN/tools/converter/source/onnx/onnxConverter.cpp:46: ONNX Model ir version: 6
[07:06:41] /workspace/MNN/tools/converter/source/onnx/onnxConverter.cpp:47: ONNX Model opset version: 11
Start to Optimize the MNN Net...
inputTensors : [ input, ]
outputTensors: [ 1482, ]
Converted Success!
Check convert result by onnx, thredhold is 0.01
input
output: 1482
1482: (1, 512, 512, )
TESTERROR 1482 value error : absMaxV:21.000000 - DiffMax 19.000000
Error for output 1482
Save mnn result to .error director

Test Node : ArgMax_731 False
Error is between Div_730 and ArgMax_731
请问这是什么问题

@jxt1234
Copy link
Collaborator

jxt1234 commented Dec 20, 2024

ArgMax 有可能因为数值误差导出取出来的 index 不一样,建议用实际输入测试一下。

@jxt1234 jxt1234 added the question Further information is requested label Dec 20, 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