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

3 次查看(过去 30 天)
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.

采纳的回答

Don Mathis
Don Mathis 2022-3-29
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by