Unity-Technologies / barracuda-release

Other
564 stars 76 forks source link

ONNX import issue #306

Closed ahwiggers closed 1 year ago

ahwiggers commented 1 year ago

Hello,

I am trying to import a model that I trained using tensorflow (version 2.9.1) and converted to a .onnx format using tf2onnx (version 1.12.1). The input is a 5 dimensional tensor (number, height, width, depth, channels). However when I import the model into Unity using Barracuda (version 3.0.0) I get the following error:

Asset import failed, "Assets/MLModels/model_3d 1.onnx" > OnnxImportException: Unexpected error while parsing layer StatefulPartitionedCall/model_15/conv3d_transpose_5/conv3d_transpose:0 of type ConvTranspose. CMHW layout requires kernel weight tensor of rank 3 or higher, but got 5

From my understanding it has an issue with the input of the first Convolution 3D Transpose layer in my model (some info shown below). It requires the kernel weight tensor to be of rank 3 or higher, but got rank 5. I'm confused why this is an issue because it just needs to be at least rank 3 and in my case it's rank 5. Any insight into why this might be an issue?

EDIT: Upon further investigating, I see that Convolution 3D Transposes have not been implemented yet. That is the root of the issue.

Screenshot 2022-12-16 144337

romygt commented 1 year ago

please I have the same issue, did you solve it

ahwiggers commented 1 year ago

please I have the same issue, did you solve it

I discovered that Barracuda does not support ConvTranspose3D (as of when I posted this), so unfortunately I was not able to use Barracuda to run inference with this model.