Skip to content

Bug: Null Reference in Unity Inference Engine code #25

@crawfis

Description

@crawfis

I get a null reference deep in the bowels of the code sporadically when I try to use this in a stress test. Error is below. I tested with both BackendType.CPU and BackendType.GPUCompute for the Workers. Seems to be an issue with:
./Library/PackageCache/com.unity.ai.inference@89644c5bfb09/Runtime/Core/TensorGeneric.cs:157

Sample that tests a sequence of images, videos and webcam by cycling through these is here: Dr. Crawfis' BlazePose Refactor for Unity

----------------Null Reference--------------
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.Awaitable1[T].SetResultAndRaiseContinuation (T result) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable+AwaitableAsyncMethodBuilder1[T].SetResult (T value) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0)
Unity.InferenceEngine.Tensor1[T].ReadbackAndCloneAsync () (at ./Library/PackageCache/com.unity.ai.inference@89644c5bfb09/Runtime/Core/TensorGeneric.cs:157) UnityEngine.Awaitable+AwaitableAsyncMethodBuilder1+StateMachineBox1[T,TStateMachine].DoMoveNext () (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable.RunOrScheduleContinuation (UnityEngine.Awaitable+AwaiterCompletionThreadAffinity awaiterCompletionThreadAffinity, System.Action continuation) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable.RaiseManagedCompletion () (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable1[T].SetResultAndRaiseContinuation (T result) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0)
UnityEngine.Awaitable+AwaitableAsyncMethodBuilder1[T].SetResult (T value) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) Unity.InferenceEngine.Tensor.ReadbackAndCloneAsync () (at ./Library/PackageCache/com.unity.ai.inference@89644c5bfb09/Runtime/Core/Tensor.cs:187) UnityEngine.Awaitable+AwaitableAsyncMethodBuilder1+StateMachineBox1[T,TStateMachine].DoMoveNext () (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable.RunOrScheduleContinuation (UnityEngine.Awaitable+AwaiterCompletionThreadAffinity awaiterCompletionThreadAffinity, System.Action continuation) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable.RaiseManagedCompletion () (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable1[T].SetResultAndRaiseContinuation (T result) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0)
UnityEngine.Awaitable+AwaitableAsyncMethodBuilder1[T].SetResult (T value) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) Unity.InferenceEngine.ComputeTensorData.DownloadAsync[T] (System.Int32 dstCount) (at ./Library/PackageCache/com.unity.ai.inference@89644c5bfb09/Runtime/Core/Backends/GPUCompute/ComputeTensorData.cs:144) UnityEngine.Awaitable+AwaitableAsyncMethodBuilder1+StateMachineBox1[T,TStateMachine].DoMoveNext () (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable.RunOrScheduleContinuation (UnityEngine.Awaitable+AwaiterCompletionThreadAffinity awaiterCompletionThreadAffinity, System.Action continuation) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable.RaiseManagedCompletion () (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0) UnityEngine.Awaitable1[T].SetResultAndRaiseContinuation (T result) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0)
UnityEngine.Rendering.AsyncGPUReadbackRequest.InvokeCallback (System.Action`1[T] callback, UnityEngine.Rendering.AsyncGPUReadbackRequest obj) (at <7fa9e22a6c4a40e5abbae8599fd0bce3>:0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions