Effacer les filtres
Effacer les filtres

How to solve the error when trying to convert a DAGNetwork to ONNX?

7 vues (au cours des 30 derniers jours)
Hao Ding
Hao Ding le 27 Mar 2022
Commenté : Hao Ding le 31 Mar 2022
I use Matlab R2021b and toolbox Converter for ONNX model version 21.2.
I only used these code:
net=load('pointnetplusTrained.mat','net').net;
filename = "pointnetplusTrained.onnx";
exportONNXNetwork(net,filename)
My net here has a value of 1X1 DAGNetwork and looks like this
The model is trained the same as Matlab documentation:
Error message shows below
Error using containers.Map/subsref
The specified key is not present in this container.
Error in nnet.internal.cnn.onnx.ConverterForConvolutionLayers/toOnnx (line 19)
inputTensorLayout = TensorLayoutMap(inputTensorNames{1});
Error in nnet.internal.cnn.onnx.ConverterForNetwork/networkToGraphProto (line 115)
= toOnnx(layerConverter, nodeProtos, TensorNameMap, TensorLayoutMap);
Error in nnet.internal.cnn.onnx.ConverterForNetwork/toOnnx (line 45)
modelProto.graph = networkToGraphProto(this);
Error in nnet.internal.cnn.onnx.exportONNXNetwork (line 17)
modelProto = toOnnx(converter);
Error in exportONNXNetwork (line 38)
nnet.internal.cnn.onnx.exportONNXNetwork(Network, filename, varargin{:});
Error in untitled3 (line 3)
exportONNXNetwork(net,filename)
Thanks in advance.

Réponse acceptée

Don Mathis
Don Mathis le 29 Mar 2022
Hi,
Unfortunately, this is a bug in the ONNX exporter. If you are able to edit your MATLAB source code, you can fix it as follows:
In MATLAB, enter
edit nnet.internal.cnn.onnx.ConverterForUnsupportedLayer
Then change line 42 from
if isequal(OutputNames, {'out'})
to
if numel(OutputNames)==1

Plus de réponses (0)

Catégories

En savoir plus sur Image Data Workflows dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by