MNN
MNN copied to clipboard
yolov8s onnx2mnn 转换后与onnxruntime推理精度存在差异
版本:mnn develop版本 c++ 系统:windows x64 cpu: i7-12700 问题: 1.模型能够正确转换,转换日志:
(base) D:\MNN\build_convert>MNNConvert.exe -f ONNX --modelFile yolov8s.onnx --MNNModel yolov8s.mnn --bizCode biz --info
The device support i8sdot:0, support fp16:0, support i8mm: 0
Start to Convert Other Model Format To MNN Model..., target version: 2.9
[11:48:45] :46: ONNX Model ir version: 8
[11:48:45] :47: ONNX Model opset version: 17
[11:48:45] :146: Check it out ==> /model.10/Resize_output_0 has empty input, the index is 1
[11:48:45] :146: Check it out ==> /model.13/Resize_output_0 has empty input, the index is 1
Start to Optimize the MNN Net...
inputTensors : [ images, ]
outputTensors: [ output0, ]
Converted Success!
- 在使用testMNNfromOnnx.py测试时报错:
Dir exist
onnx\test.onnx
tensor(float)
['output0']
inputs:
images
onnx/
2024-06-27 11:57:19.4087579 [E:onnxruntime:, sequential_executor.cc:516 onnxruntime::ExecuteKernel] Non-zero status code returned while running Concat node. Name:'/model.11/Concat' Status Message: concat.cc:157 onnxruntime::ConcatBase::PrepareForCompute Non concat axis dimensions must match: Axis 2 has mismatched dimensions of 1 and 2
Traceback (most recent call last):
File "D:\MNN\tools\script\testMNNFromOnnx.py", line 277, in <module>
message = t.Test()
File "D:\MNN\tools\script\testMNNFromOnnx.py", line 263, in Test
self.__run_onnx()
File "D:\MNN\tools\script\testMNNFromOnnx.py", line 172, in __run_onnx
outputs = ort_session.run(None, inputs)
File "E:\develop\minconda3\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 220, in run
return self._sess.run(output_names, input_feed, run_options)
onnxruntime.capi.onnxruntime_pybind11_state.Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running Concat node. Name:'/model.11/Concat' Status Message: concat.cc:157 onnxruntime::ConcatBase::PrepareForCompute Non concat axis dimensions must match: Axis 2 has mismatched dimensions of 1 and 2
- 在推理验证时,检测不到物体,与onnxruntime 输出的前50个数据进行对比(前处理完全一致,onnxruntime结果正确)
# onnxruntime
8.39064 12.5779 15.8589 25.0476 35.0179 42.9783 49.7049 59.545 67.6186 74.6575 82.5757 91.2104 99.
1115 106.85 114.735 122.665 130.679 138.79 146.902 155.239 163.29 171.517 179.667 187.462 195.415 203.406 211.381 219.70
1 227.699 235.652 243.504 251.547 259.571 267.472 275.204 283.044 291.117 299.291 307.419 315.447 323.287 331.156 339.11
8 347.093 355.115 363.298 371.416 379.408 387.401 395.321
# mnn
5.95572 16.6375 23.3086 30.3797 37.0359 43.5946 50.508 56.9804 62.6321 66.3245 69.5755 80.3902 92.
6067 102.775 111.836 120.055 128.441 136.89 145.337 154.063 162.608 170.739 178.883 187.119 195.331 203.371 211.371 219.
497 227.655 235.627 243.682 251.764 259.811 267.784 275.702 283.735 291.771 299.783 307.743 315.715 323.704 331.652 339.
602 347.573 355.52 363.437 371.28 379.27 387.323 395.338
onnx模型文件:文件太大发你邮箱:[email protected]
Marking as stale. No activity in 60 days.