Unity-Technologies / barracuda-release

Other
564 stars 76 forks source link

OnnxImportException: Unknown type LayerNormalization encountered while parsing layer /transformer/layers.0/norm1/LayerNormalization_output_0. #332

Closed PascalSpiegler closed 10 months ago

PascalSpiegler commented 10 months ago

I am attempting to import Meta's Segment Anything Model (SAM) as a .onnx file into Unity using the Barracuda plugin, but I am encountering an asset import failure. Here are the details of the issue:

After exporting the SAM model as a .onnx file from here and importing the model to Unity’s Barracuda Plugin, I receive the following error during the import process:

Asset import failed, "Assets/Models/sam_onnx_example.onnx" > OnnxImportException: Unknown type LayerNormalization encountered while parsing layer /transformer/layers.0/norm1/LayerNormalization_output_0.

Environment: Unity Version: 2022.3.3f1 Barracuda Version: 3.0.1

Is this caused by a lack of support of LayerNormalization? Any guidance on how to resolve this issue and successfully import the SAM model into Unity using Barracuda would be much appreciated. Thank you!

LiutaurasVy commented 10 months ago

Hi,

Thank you for reporting this issue!

Can you see if the issue still reproduces with the Sentis package?

The Sentis package is a new version of Barracuda, and most issues with Barracuda are already fixed for Sentis.

If you still experience the issue after upgrading please post about it in the Sentis Discussions forum, and we will investigate it further.

You can refer here for the Sentis package installation guide: https://discussions.unity.com/t/about-sentis-beta/260899/24

PascalSpiegler commented 10 months ago

It works with the Sentis package. Thank you!