MATLAB Answers

0

Fail to export net to ONNX

Asked by Patrick ONeal on 11 Apr 2019
Latest activity Commented on by 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.

  0 Comments

Sign in to comment.

Products


Release

R2019a

2 Answers

Answer by Don Mathis on 12 Apr 2019
 Accepted Answer

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, pardon my lack of knowledge here, but is this package being developed by Mathworks? Is there a way for me to get a good enough estimate of when exporting a 3d image network will be supported, in order to get back to my management about it? It looks very promising to us ...
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.
Understood! Much appreciated.

Sign in to comment.


Answer by Don Mathis on 11 Apr 2019

Unfortunately, exporting 3D layers to ONNX is not yet supported.

  1 Comment

Thank you for your answer. What are my alternatives here?

Sign in to comment.