无法导入onnx模型

net = importNetworkFromONNX("model5.onnx")
MEX 文件 'C:\ProgramData\MATLAB\SupportPackages\R2025b\toolbox\nnet\supportpackages\onnx\+nnet\+internal\+cnn\+onnx\onnxmex.mexw64' 无效: 找不到指定的程序。
出错
ModelPtr = onnxmex(int32(FuncName.EdeserializeFromFile), filename);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
出错
modelProto = nnet.internal.cnn.onnx.ModelProto(Filename);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
出错
Network = nnet.internal.cnn.onnx.importONNXNetwork(modelFolder, 'TargetNetwork', 'dlnetwork', ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
出错
Network = nnet.internal.cnn.onnx.importNetworkFromONNX(modelfile, varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Réponses (1)

Esther
Esther il y a 23 minutes

0 votes

This is a known compatibility issue between MATLAB R2025b Update 3 (and later) and the 'Deep Learning Toolbox Converter for ONNX Model Format' support package (version 25.2.2 and earlier).
This issue was resolved with MATLAB R2025b Update 4 & the February 2026 release of the 'Deep Learning Toolbox Converter for ONNX Model Format' support package (version 25.2.5), which was released on February 20th, 2026.
First, make sure to upgrade to R2025b Update 4 or later by using Help > Check for Updates:
Then, uninstall the ONNX support package by clicking the "Manage" button in the Add-On Panel and then selcting "Uninstall" in Add-On Manager:
Finally, reinstall the ONNX support package from the Add-On Explorer. To confirm that the most recent version was installed, use:
>> matlabshared.supportpkg.getInstalled
Name Version Base Product
--------------------------------------------------------- ------- ------------
Deep Learning Toolbox Converter for ONNX Model Format 25.2.5

Catégories

Produits

Version

R2025b

Question posée :

le 25 Mar 2026

Réponse apportée :

le 4 Juin 2026 à 8:35

Community Treasure Hunt

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

Start Hunting!