Filter löschen
Filter löschen

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

8 Ansichten (letzte 30 Tage)
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',...
'OutputLayerType','classification')
analyzeNetwork(net)
importONNXFunction :
params = importONNXFunction('R3D_50.onnx',...
'resnet3D_50');
In both cases, the following internal errors occurred:
Error using nnet.internal.cnn.onnx.onnxmex
Invalid MEX-file
'C:\ProgramData\MATLAB\SupportPackages\R2020b\toolbox\nnet\supportpackages\onnx\+nnet\+internal\+cnn\+onnx\onnxmex.mexw64':
动态链接库(DLL)初始化例程失败。
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 =
nnet.internal.cnn.onnx.ModelProto(Filename);
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

Akzeptierte Antwort

cui,xingxing
cui,xingxing am 16 Mär. 2021
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\
  2 Kommentare
cui,xingxing
cui,xingxing am 8 Mai 2021
Functions affected by this bug are listed below.
  1. importONNXNetwork
  2. importONNXLayers
  3. importONNXFunction
  4. exportONNXNetwork
  5. importCaffeNetwork
  6. importCaffeLayers
Workaround
As a workaround, move the DLL to the directory where the MEX-file is located.
If you use Deep Learning Toolbox Converter for ONNX Model Format, type the following at the MATLAB command line.
>> source = fullfile( matlabshared.supportpkg.getSupportPackageRoot, "bin", "win64", "onnxpb.dll" );
>> destination = fullfile( matlabshared.supportpkg.getSupportPackageRoot, "toolbox", "nnet", "supportpackages", "onnx", "+nnet", "+internal", "+cnn", "+onnx", "onnxpb.dll" );
>> movefile( source, destination );
If you use Deep Learning Toolbox Importer for Caffe Models, type the following at the MATLAB command line.
>> source = fullfile( matlabshared.supportpkg.getSupportPackageRoot, "bin", "win64", "caffelib.dll" );
>> destination = fullfile( matlabshared.supportpkg.getSupportPackageRoot, "toolbox", "nnet", "supportpackages", "caffe_importer", "+nnet", "+internal", "+cnn", "+caffe", "caffelib.dll" );
>> movefile( source, destination );
Reference here:

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Ting Su
Ting Su am 15 Mär. 2021
Hi
Can you tell us which release of MATLAB you are using?
Ting

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by