Fail to export net to ONNX

9 views (last 30 days)
Patrick ONeal
Patrick ONeal on 11 Apr 2019
Commented: Patrick ONeal on 20 May 2019
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
Don Mathis
Don Mathis on 20 May 2019
Yes, the ONNX Converter support package is being actively developed by MathWorks. However, we have a policy not to estimate when, or even if, specific future features will be available. So I can't make any promises beyond saying that exporting 3d networks is considered highly important to us.
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.

Categories

Find more on Image Data Workflows in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!