Runtime Error when working with Unity
Description
Error : "RuntimeError: Tensorflow.NET cannot find a backend. Please install one of the following packages for your program: SciSharp.TensorFlow.Redist, SciSharp.TensorFlow.Redist-Linux-GPU, SciSharp.TensorFlow.Redist-Windows-GPU. For more details, please visit https://github.com/SciSharp/TensorFlow.NET. If it still not work after installing the backend, please submit an issue to https://github.com/SciSharp/TensorFlow.NET/issues Tensorflow.tensorflow..ctor () (at <95fc4d5a370b48ed8109102c0196c37d>:0) Tensorflow.Binding..cctor () (at <95fc4d5a370b48ed8109102c0196c37d>:0) Rethrow as TypeInitializationException: The type initializer for 'Tensorflow.Binding' threw an exception."
I trying to merge tensorflow with Unity but after importing SciSharp.Tensorflow.Redist package into my project the above error occurs. I have also uploaded various packages and dependencies needed to run Tensorflow.NET into my project also and given below:-
-Google Protobuf -Method Boundary Aspect -Microsoft.ML and its dependencies -Newtonsoft.Json -Protobuf.Text -Razorvine.Pickle -Serilog -Serilog.Sinks.Console -System.Buffers -System.Collections.immutable -System.Diagnostics.DiagnosticSource -System.Memory -System.Numerics.Tensors -System.Numerics.Vectors -System.Runtime.CompilerServices.Unsafe -System.Threading.Channels -System.Threading.Tasks.Extensions -Tensorflow.Bindings
I have imported this "SciSharp.Tensorflow.Redist" package since previous Runtime error mentioned that this package will resolve it that and then this above mentioned error came.
If needed this is code i have been working Code : "using System.Collections; using System.Collections.Generic; using UnityEngine; using static Tensorflow.Binding;
public class ModelLoader : MonoBehaviour { [SerializeField] private string modelPath; // Start is called before the first frame update void Start() { var model = tf.keras.models.load_model(modelPath); }
// Update is called once per frame
void Update()
{
}
} " So i am trying to load the pose landmarks model of Mediapipe which is TFLITE model and above error is coming continuously. Help!!!!!!!!