ONNX export yields Error !

4 次查看(过去 30 天)
Dear MathWorks Deep Learning Toolbox Team:
Hi, I tried to use exportONNXNetwork, I ran this part of code, but i saw this error, could you help me pls?!
Usage example:
%% Export to ONNX model format
net = squeezenet;
filename = 'squeezenet.onnx';
exportONNXNetwork(net,filename);
-------------------------------------
this error appear:
Error using nnet.internal.cnn.onnx.onnxmex
Invalid MEX-file
'C:\ProgramData\MATLAB\SupportPackages\R2019b\toolbox\nnet\supportpackages\onnx\+nnet\+internal\+cnn\+onnx\onnxmex.mexw64':
A dynamic link library (DLL) initialization routine failed.
Error in nnet.internal.cnn.onnx.ModelProto/writeToFile (line 50)
ModelPtr = onnxmex(int32(FuncName.EnewModelProto));
Error in nnet.internal.cnn.onnx.exportONNXNetwork (line 37)
writeToFile(modelProto, Filename);
Error in exportONNXNetwork (line 40)
nnet.internal.cnn.onnx.exportONNXNetwork(Network, filename, varargin{:});
Error in Untitled (line 5)
exportONNXNetwork(net,filename)
  3 个评论
David
David 2021-4-3
On Mac OS using Matlab 2021a I get:
>> exportONNXNetwork(trainedNetwork_1,'ONNXThumbs.onnx')
Error using nnet.internal.cnn.onnx.onnxmex
Unexpected Standard exception from MEX file.
What() is:Failed to load ONNX Shared library.
..
Error in nnet.internal.cnn.onnx.ModelProto/writeToFile (line 52)
ModelPtr = onnxmex(int32(FuncName.EnewModelProto));
Error in nnet.internal.cnn.onnx.exportONNXNetwork (line 38)
writeToFile(modelProto, Filename);
Error in exportONNXNetwork (line 38)
nnet.internal.cnn.onnx.exportONNXNetwork(Network, filename, varargin{:});
Adrià López Escoriza
Same, the bug report does not seem solve the issue in MacOS

请先登录,再进行评论。

采纳的回答

Jon Cherrie
Jon Cherrie 2021-4-4
It looks like you are hitting this bug:
There is a workaround listed in that bug report.

更多回答(1 个)

Neelanjana Pal
Neelanjana Pal 2020-2-12
I also got the same issue but restarting the system solved my problem
  4 个评论
Ting Su
Ting Su 2021-3-15
The cause of R2021a is that the bin folder created under C:\ProgramData\MATLAB\SupportPackages\R2021a\bin\win64\ is not recognized as a system path.
The following command should help.
mv C:\ProgramData\MATLAB\SupportPackages\R2021a\bin\win64\onnxpb.dll C:\ProgramData\MATLAB\SupportPackages\R2021a\toolbox\nnet\supportpackages\onnx\+nnet\+internal\+cnn\+onnx\
cui,xingxing
cui,xingxing 2021-3-16
@Ting SuAfter copying onnxpb.dll, it can work now, thank you very much!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by