MATLAB Answers

Fail to export net to ONNX

7 views (last 30 days)
I'm trying to use the exportONNXNetwork function, in order to load it later into CNTK, but I'm getting a lot of warnings that I don't understand. I was hoping to get some pointers on what they might mean.
>> load('netTry.mat')
>> netFileToOMX = 'netFileToOMX_try1';
>> exportONNXNetwork(net,netFileToOMX);
This is the code i'm using, and here are the warnings:
A bunch of these:
Warning: ONNX does not support layer 'nnet.cnn.layer.Image3DInputLayer'. Exporting to ONNX operator 'com.MathWorks.Placeholder'.
> In nnet.internal.cnn.onnx.NNTLayerConverter.makeLayerConverter (line 173)
In nnet.internal.cnn.onnx.ConverterForNetwork/networkToGraphProto (line 80)
In nnet.internal.cnn.onnx.ConverterForNetwork/toOnnx (line 44)
In nnet.internal.cnn.onnx.exportONNXNetwork (line 34)
In exportONNXNetwork (line 40)
Warning: ONNX does not support layer 'nnet.cnn.layer.Convolution3DLayer'. Exporting to ONNX operator 'com.MathWorks.Placeholder'.
> In nnet.internal.cnn.onnx.NNTLayerConverter.makeLayerConverter (line 173)
In nnet.internal.cnn.onnx.ConverterForNetwork/networkToGraphProto (line 80)
In nnet.internal.cnn.onnx.ConverterForNetwork/toOnnx (line 44)
In nnet.internal.cnn.onnx.exportONNXNetwork (line 34)
In exportONNXNetwork (line 40)
Warning: ONNX does not support layer 'nnet.cnn.layer.Convolution3DLayer'. Exporting to ONNX operator 'com.MathWorks.Placeholder'.
> In nnet.internal.cnn.onnx.NNTLayerConverter.makeLayerConverter (line 173)
In nnet.internal.cnn.onnx.ConverterForNetwork/networkToGraphProto (line 80)
In nnet.internal.cnn.onnx.ConverterForNetwork/toOnnx (line 44)
In nnet.internal.cnn.onnx.exportONNXNetwork (line 34)
In exportONNXNetwork (line 40)
And finally this:
Error using nnet.internal.cnn.onnx.ConverterForSoftmaxLayer/toOnnx (line 32)
Assertion failed.
Error in nnet.internal.cnn.onnx.ConverterForNetwork/networkToGraphProto (line 81)
[nodeProto, paramInitializers, paramInputs, netInputs, netOutputs, layerMap] = toOnnx(layerConverter, TensorNameMap);
Error in nnet.internal.cnn.onnx.ConverterForNetwork/toOnnx (line 44)
modelProto.graph = networkToGraphProto(this);
Error in nnet.internal.cnn.onnx.exportONNXNetwork (line 34)
modelProto = toOnnx(converter);
Error in exportONNXNetwork (line 40)
nnet.internal.cnn.onnx.exportONNXNetwork(Network, filename, varargin{:});
Any help appreciated.

Accepted Answer

Don Mathis
Don Mathis on 12 Apr 2019
I don't think you'll be able to export 3d image networks until the support package supports it (expected later this year). If you're able to post your network here, I could see if there are any other potential issues besides the 3d Conv layers.
  3 Comments
Patrick ONeal
Patrick ONeal on 20 May 2019
Understood! Much appreciated.

Sign in to comment.

More Answers (1)

Don Mathis
Don Mathis on 11 Apr 2019
Unfortunately, exporting 3D layers to ONNX is not yet supported.
  1 Comment
Patrick ONeal
Patrick ONeal on 11 Apr 2019
Thank you for your answer. What are my alternatives here?

Sign in to comment.

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!