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

importONNXFunction报错 #2

Open
dada1437903138 opened this issue Apr 16, 2021 · 3 comments
Open

importONNXFunction报错 #2

dada1437903138 opened this issue Apr 16, 2021 · 3 comments

Comments

@dada1437903138
Copy link

您好,当我运行您的代码的时候在:

params = importONNXFunction(model,customYoloV5FcnName);

这一步产生了错误,错误信息如下:

错误使用 nnet.internal.cnn.onnx.onnxmex
MEX 文件 'C:\ProgramData\MATLAB\SupportPackages\R2021a\toolbox\nnet\supportpackages\onnx\+nnet\+internal\+cnn\+onnx\onnxmex.mexw64' 无效: 找不到指定的模块。

出错 nnet.internal.cnn.onnx.ModelProto (第 32 行)
                ModelPtr = onnxmex(int32(FuncName.EdeserializeFromFile), filename);

出错 nnet.internal.cnn.onnx.importONNXFunction (第 8 行)
modelProto       = nnet.internal.cnn.onnx.ModelProto(inputFilename);

出错 importONNXFunction (第 39 行)
params = nnet.internal.cnn.onnx.importONNXFunction(modelfile, outputFunctionName);

权重文件我分别使用了自己用u版yolo v5项目训练出来的yolo v5s模型(转换成了onnx格式)和您网盘里提供的模型,都报了同样的错

@dada1437903138
Copy link
Author

您好,我已经解决了这个问题,它的原因好像是matlab自己的一个bug,参考了网站上的解决方案https://www.mathworks.com/matlabcentral/fileexchange/67296-deep-learning-toolbox-converter-for-onnx-model-format
把C:\ProgramData\MATLAB\SupportPackages\R2021a\bin\win64\onnxpb.dll
复制一份到
C:\ProgramData\MATLAB\SupportPackages\R2021a\toolbox\nnet\supportpackages\onnx+nnet+internal+cnn+onnx
即可解决问题

@cuixing158
Copy link
Owner

cuixing158 commented Apr 16, 2021 via email

@havefunheehee
Copy link

您好,可以请教一下您使用yolov5训练出来的.pt权重是如何转换成.onnx模型文件的吗?是使用yolov5项目自带的export.py模块进行转化的吗?我使用该模块转换出来的模型文件放入matlab中进行推理出现了大面积的错误识别框,您有遇到过类似的问题吗?您是如何解决的呢?期待您的回复,谢谢您。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants