Closed TriceHelix closed 2 years ago
Edit: I just checked the forums again and actually got an answer from the Unity Team. It sounds like it might be a bug, so I'm closing this issue and might make a bug report or wait for the improvements. Sorry for the unnecessary issue! For anyone stumbling on this in the future, here is the forum thread with the reply: https://forum.unity.com/threads/exception-must-have-input-rank-for-165-in-order-to-convert-axis-for-nhwc-op.1248247/
I am trying to import an ONNX model that I exported from PyTorch, however importing only works when not setting the
dynamic_axes
parameter in PyTorch'storch.onnx.export()
function. If I do make the input or output size dynamic, I get the following error when trying to import the .onnx file:Now I'm wondering what I'm doing wrong, since I thought Barracuda supports dynamic input sizes and shapes.
Some more possibly relevant info: Barracuda Version: 3.0.0 (according to Package Manager) Unity Editor Version: 2021.2.10f ONNX Opset: 9 The code I used to export the model from PyTorch (excluding irrelevant sections):
The input and output are both Tensors in the NCHW format.
I would really appreciate help and didn't want to report a bug without knowing whether the error was on my end. My research on the forums and past discussions have not yielded great results either.
Thank you in advance!