Got an error while importing an onnx model for segment anything

I am trying to use a segment anything model in unity. I have installed the latest version of sentis package and Unity. I have tested the onnx model in the python environment outside unity and it worked well. When I imported it, I got the message:
Unity.Sentis.Model+ImporterWarning: required input 2 was not found

However, there should be only one input which is the image array. I cannot figure out why the onnx importer is looking for the second input. I am attaching the screenshot. It would be very appreciated if someone could give me a direction or solution. Thanks!


1 Like

Upgrade to the newly released Sentis version: "com.unity.sentis": "1.3.0-pre.1" and make sure to reimport the model.
With the newest version mobilesam models import without errors for me.

For running the model: With GPU backend I still get some errors, but at least the model imports and CPU inference seems to work.

That seems to be some import issue. Most likely due to a layer having a input2 that is null. Think of reduce with null axis. Could you tell us which layer it is? Or share the model. We can tell you a workaround or patch the problem

What error are you getting on the GPU?