AlexRibard / Barracuda-U-2-NetTest

Test project for implementing U-2-Net segmentation network in Barracuda
MIT License
8 stars 5 forks source link

Barracuda inference error #1

Open kidach1 opened 4 years ago

kidach1 commented 4 years ago

Hi, I'm trying to run some ML models in Unity and found your informative repository, but I got this error.

ArgumentException: Off-axis dimensions must match
Unity.Barracuda.TensorExtensions.Concat (Unity.Barracuda.TensorShape[] shapes, System.Int32 axis) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/TensorExtensions.cs:229)
Unity.Barracuda.ModelAnalyzer.ListTemporaryTensorShapes (Unity.Barracuda.Model model, System.Collections.Generic.IDictionary`2[TKey,TValue] inputShapes, System.Collections.Generic.IDictionary`2[System.String,System.Nullable`1[Unity.Barracuda.TensorShape]]& shapesByName) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/ModelAnalyzer.cs:373)
Unity.Barracuda.ModelAnalyzer.ListTemporaryTensorShapes (Unity.Barracuda.Model model, System.Collections.Generic.IDictionary`2[TKey,TValue] inputShapes) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/ModelAnalyzer.cs:66)
Unity.Barracuda.ModelAnalyzer.FindLargestNecessaryTensorShape (Unity.Barracuda.Model model, System.Collections.Generic.IDictionary`2[TKey,TValue] inputShapes) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/ModelAnalyzer.cs:532)
Unity.Barracuda.GenericVarsWithPreallocation.PrepareStorage (Unity.Barracuda.Model model, Unity.Barracuda.IOps ops, System.Collections.Generic.IDictionary`2[TKey,TValue] inputShapes) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:1125)
Unity.Barracuda.GenericWorker.PrepareForInput (System.Collections.Generic.IDictionary`2[TKey,TValue] inputShapes) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:81)
Unity.Barracuda.GenericWorker.SetInput (System.String name, Unity.Barracuda.Tensor x) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:92)
Unity.Barracuda.GenericWorker.SetInput (Unity.Barracuda.Tensor x) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:99)
Unity.Barracuda.GenericWorker.Execute (Unity.Barracuda.Tensor input) (at Library/PackageCache/com.unity.barracuda@1.0.0/Barracuda/Runtime/Core/Backends/GenericWorker.cs:111)
Inference.Update () (at Assets/Scripts/Inference.cs:56)

Could you tell me how can I fix this?

Thanks!

AlexRibard commented 3 years ago

Hi! Can you share your onnx models? Did you post a issue on https://github.com/Unity-Technologies/barracuda-release?