Unity-Technologies / barracuda-release

Other
564 stars 76 forks source link

Trouble importing LSTM network model #315

Open digitalmonkey opened 1 year ago

digitalmonkey commented 1 year ago

Hi, I'm trying to import the following LSTM model from onnx (see attached). test.onnx.zip

The output named "dense" is supposed to be a 1x80 size, but instead in Barracuda, I see the output as 10x80. Viewing the onnx file with Netron shows the 1x80 structure but Barracuda seems to have lost the size information. Does this imply the conversion was not successful?

I also am getting warnings that I have Unsupported attribute activations, node of type LSTM, Value will be ignored and defaults to [Sigmoid, Tanh, Tanh]. Does this also imply the conversion will not be successful and the resulting network will likely not infer as I expected?

Finally, as Barracuda converts to NHWC format, does this imply I must make sure to convert my arrays so that my input tensors in the same NHWC format as well? My arrays are currently stored as NCHW.

Thank you for any help you can provide.

digitalmonkey commented 1 year ago

Okay one update: I was able to get the proper output once I made sure my input tensor was the correct size. However, can you confirm I need to make sure I pass in my input tensor in NHWC format? Ie., the input is not converted automatically in barracuda?