Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Error when working with Unity #1271

Open
ShreyPatel1311 opened this issue Sep 24, 2024 · 0 comments
Open

Runtime Error when working with Unity #1271

ShreyPatel1311 opened this issue Sep 24, 2024 · 0 comments

Comments

@ShreyPatel1311
Copy link

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!!!!!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant