Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Bug NullReferenceException: Object reference not set to an instance of an object at Unity.Sentis.Compile

Discussion in 'Editor & General Support' started by m22ai873, Apr 9, 2024.

  1. m22ai873

    m22ai873

    Joined:
    Jan 14, 2024
    Posts:
    8
    Hello ,
    I am trying to use the sentis object detection yolo model in Unity .

    const string modelName = "yolov8n.sentis";//tried with .onnx as well and var model = ModelLoader.Load(modelAsset);
    model = ModelLoader.Load(Application.streamingAssetsPath + "/" + modelName);

    The .onnx and .sentis model are already there in the Asset folder and I have also clicked ("Serialize to Streaming asset");

    But on running the apk in the Android phone I get this :

    04-09 22:58:58.781 21004 21036 E Unity : NullReferenceException: Object reference not set to an instance of an object
    04-09 22:58:58.781 21004 21036 E Unity : at Unity.Sentis.Compiler.Analyser.GraphLogicAnalysis.GetDefaultInputName (Unity.Sentis.Model model) [0x00000] in <307d73e2bd0e483c97040996a4b5da46>:0
    04-09 22:58:58.781 21004 21036 E Unity : at Unity.Sentis.GenericWorker..ctor (Unity.Sentis.Model model, Unity.Sentis.IBackend backend, Unity.Sentis.IVars vars, System.Boolean verbose, System.Boolean takeoverWeights) [0x00018] in <307d73e2bd0e483c97040996a4b5da46>:0
    04-09 22:58:58.781 21004 21036 E Unity : at Unity.Sentis.BackendFactory.CreateWorker (Unity.Sentis.BackendType backendType, Unity.Sentis.Model model, Unity.Sentis.WorkerFactory+WorkerConfiguration workerConfiguration) [0x00071] in <307d73e2bd0e483c97040996a4b5da46>:0
    04-09 22:58:58.781 21004 21036 E Unity : at Unity.Sentis.WorkerFactory.CreateWorker (Unity.Sentis.BackendType backendType, Unity.Sentis.Model model, Unity.Sentis.WorkerFactory+WorkerConfiguration workerConfiguration) [0x00000] in <307d73e2bd0e483c97040996a4b5da46>:0
    04-09 22:58:58.781 21004 21036 E Unity : at Unity.Sentis.WorkerFactory.CreateWorker (Unity.Sentis.BackendType backendType, Unity.Sentis.Model mod


    BackendType is CPU ( check with GPU as well )

    This works fine on Windows and Mac.
    I am on Sentis 1.3.0-pre.3 and Untiy version : 2023.3.0b5

    Regards,
    S