TensorFlow.NET
TensorFlow.NET copied to clipboard
Tensor.NET can not find a Tensor Backend
Description
using System;
using Tensorflow;
using static Tensorflow.Binding;
using System.Diagnostics;
class TensorEX {
static void Main() {
var watch = Stopwatch.StartNew();
var shape = new int[] { 10000, 10000 };
var randomMatrix = tf.random.uniform(shape: shape, minval: 0, maxval: 1f);
var dotOperation = tf.linalg.matmul(randomMatrix, randomMatrix);
var sumOperation = tf.reduce_sum(dotOperation);
var result = sumOperation.numpy();
Console.WriteLine($"Tensor computing result: {result}");
watch.Stop();
Console.WriteLine($"Time taken: {watch.ElapsedMilliseconds} ms");
}
}
dotnet add package TensorFlow.NET dotnet add package TensorFlow.Keras dotnet add package SciSharp.TensorFlow.Redist
My system is running on Mac OS 13.4.1 (Ventura), and even though I've installed all three items mentioned, I'm still getting the message below. I've already installed the Python Tensorflow package and even included the project path in the PATH, but the message still pops up
Hello, you can refer to #1141. If there still exist some problem, please let me know.
Hello @sang416! Do you succeed in solving the issues?
Currently I'm also using Ventura 13.4.1 on M1. Even though I already installed the SciSharp.TensorFlow.Redist-OSX (using nuget), it still brings up the same exception messages.
Hello @sang416! Do you succeed in solving the issues?
Currently I'm also using Ventura 13.4.1 on M1. Even though I already installed the SciSharp.TensorFlow.Redist-OSX (using nuget), it still brings up the same exception messages.
No, I tried again referring to #1141 above, but it's still not working. Do you happen to know a solution?
Hello @sang416! Do you succeed in solving the issues? Currently I'm also using Ventura 13.4.1 on M1. Even though I already installed the SciSharp.TensorFlow.Redist-OSX (using nuget), it still brings up the same exception messages.
No, I tried again referring to #1141 above, but it's still not working. Do you happen to know a solution?
Nope. As I'm developing for my Unity project, I used Barracuda as the inference library for now. Although, it has its own issues too.
I'll update to this issue if there's any solution that I found 👍
I've installed the SciSharp.TensorFlow.Redist-OSX package which does indeed add the arm64 libtensorflow*.dylib but it puts them in the runtimes/osx-x64 directory. If you manually move these over to runtimes/osx-arm64 (which I did as a build step) it gets further. However there is something else wrong with the library
Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'TFC_GetHandleShapeAndType' in shared library 'tensorflow'.
This is at the fit step so it does get through creating the model so it does work somewhat. But this symbol TFC_GetHandleShapeAndType is not in the arm64 library at all (at least searched via strings) but it is in the linux x64 .so file.
Hello! Any news for Apple Silicon?