MATLAB Answers

importONNXLayers, importONNXNetwork, and importONNXFunction can't import my onnx model?

95 views (last 30 days)
cui on 3 Mar 2021
Answered: cui on 16 Mar 2021 at 4:44
As of March 3, 2021, importONNXLayers, importONNXNetwork, and importONNXFunction in the latest official version of onnx importer/exporter cannot import my onnx model?
My model link: R3D_50.onnx
Extraction code: kuni
net = importONNXLayers('R3D_50.onnx',...
importONNXFunction :
params = importONNXFunction('R3D_50.onnx',...
In both cases, the following internal errors occurred:
Error using nnet.internal.cnn.onnx.onnxmex
Invalid MEX-file
Error in nnet.internal.cnn.onnx.ModelProto (line 31)
ModelPtr = onnxmex(int32(FuncName.EdeserializeFromFile), filename);
Error in nnet.internal.cnn.onnx.importONNXLayers (line 7)
modelProto =
Error in importONNXLayers (line 48)
Layers = nnet.internal.cnn.onnx.importONNXLayers(modelfile, varargin{:});
Error in testONNX2 (line 1)
net = importONNXLayers('D:\python_work\video_classification_pytorch\model\R3D_50.onnx',...
Error using nnet.internal.cnn.onnx.onnxmex

Accepted Answer

cui on 16 Mar 2021 at 4:44
As of March 15, 2021, using the latest version of MATLAB 2021a+Deep Learning Toolbox Converter for ONNX Model Format (version21.1.0) can import R3D_50.onnx, but the prerequisite is:
mv C:\ProgramData\MATLAB\SupportPackages\ R2021a\bin\win64\onnxpb.dll C:\ProgramData\MATLAB\SupportPackages\R2021a\toolbox\nnet\supportpackages\onnx\+nnet\+internal\+cnn\+onnx\




Community Treasure Hunt

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

Start Hunting!