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

4 ビュー (過去 30 日間)
Hao Ding
Hao Ding 2022 年 3 月 27 日
コメント済み: Hao Ding 2022 年 3 月 31 日
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
  1 件のコメント
Hao Ding
Hao Ding 2022 年 3 月 31 日
Thanks for the answer. The bug get fixed

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by