How to solve the error when trying to convert a DAGNetwork to ONNX?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hao Ding
el 27 de Mzo. de 2022
Comentada: Hao Ding
el 31 de Mzo. de 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.
0 comentarios
Respuesta aceptada
Don Mathis
el 29 de Mzo. de 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
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!