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

5 ビュー (過去 30 日間)
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

採用された回答

cui,xingxing
cui,xingxing 2021 年 3 月 16 日
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 件のコメント
frederic tchuisseu
frederic tchuisseu 2021 年 5 月 4 日
how to do this on macos please
cui,xingxing
cui,xingxing 2021 年 5 月 8 日
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:

サインインしてコメントする。

その他の回答 (1 件)

Ting Su
Ting Su 2021 年 3 月 15 日
Hi
Can you tell us which release of MATLAB you are using?
Ting

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by