You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you try to export a model in ONNX format, the deploy method expects the InputLayer parameters height and n_channels not to be None, even though they are meant to be used only with image data.
It would be nice not to have to specify dummy values for them when training RNNs and DNNs for example.
Thanks for bringing this topic up. width, height and n_channels are only needed for CNN models. If the model is RNN (meaning there is at least one Recurrent layer) then these parameters can be None.
Hi Victor - we don't officially support exporting an RNN model to ONNX format. With your work-around, aren't you getting an OnnxWriteError exception for your RNN layers? The error message should be something like
Activity
dxq77dxq commentedon Oct 7, 2020
Hi Victor,
Thanks for bringing this topic up. width, height and n_channels are only needed for CNN models. If the model is RNN (meaning there is at least one Recurrent layer) then these parameters can be None.
Thanks,
Maggie
dxq77dxq commentedon Oct 14, 2020
Hi Victor,
Please let me know if the answer solves the question and we can close the issue.
Thanks,
Maggie
vorodrigues commentedon Oct 14, 2020
Hi Maggie,
Thanks a lot for your answer! I raised this issue because I trained a RNN for a sentiment analysis task and then tried to export it in ONNX format:
model1.deploy(path='/models', output_format='onnx')And got the following error:
I managed to export it by adding a dummy value to the
heightandn_channelsparameters in the input layer:model1.add(InputLayer(std='STD', height=0, n_channels=1))I think that
sas_to_onnxcode might need some fix to avoid that.Thanks,
Victor
eusdougc commentedon Oct 14, 2020
Hi Victor - we don't officially support exporting an RNN model to ONNX format. With your work-around, aren't you getting an OnnxWriteError exception for your RNN layers? The error message should be something like
<layer_type> is not supported.
Doug
vorodrigues commentedon Oct 14, 2020
Hi Doug,
You are right! I'm sorry, I made many tests to find a workaround and I forgot to mention it worked with a simple DNN - NOT with the original RNN.
Here it is the code I ran:
Anyways, it's nice to know RNNs aren't supported yet.
Many thanks,
Victor