keijiro / TinyYOLOv2Barracuda

Tiny YOLOv2 on Unity Barracuda
The Unlicense
200 stars 24 forks source link

NullReferenceException #2

Closed NathanWoo closed 3 years ago

NathanWoo commented 3 years ago

Got the following error when trying to run the Pixelizer scene

NullReferenceException: Object reference not set to an instance of an object
Unity.Barracuda.ModelLoader.Load (Unity.Barracuda.NNModel model, System.Boolean verbose, System.Boolean skipWeights) (at Library/PackageCache/com.unity.barracuda@1.3.0-preview/Barracuda/Runtime/Core/ModelLoader.cs:29)
TinyYoloV2.ObjectDetector..ctor (TinyYoloV2.ResourceSet resources) (at Assets/Script/ObjectDetector.cs:37)
TinyYoloV2.Pixelizer.Start () (at Assets/Test/Pixelizer.cs:39)
NathanWoo commented 3 years ago

Besides downloading the ONNX model, also need to set the model asset for Asssets/Test/TinyYOLOv2.asset

keijiro commented 3 years ago

This happens when you open the project before putting the downloaded file (Unity Editor removes the .meta file when the file body is missing).