TensorFlow.NET
TensorFlow.NET copied to clipboard
[BUG Report]: Cannot find backend on Apple Silicon mac
Description
When running on Apple Silicon mac (M1 Pro) exception is thrown
Unhandled exception. System.TypeInitializationException: The type initializer for 'Tensorflow.Binding' threw an exception.
---> Tensorflow.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
at Tensorflow.tensorflow..ctor()
at Tensorflow.Binding..cctor()
--- End of inner exception stack trace ---
at Tensorflow.Binding.get_tf()
at Program.<Main>$(String[] args) in /Users/george/Documents/C#/SampleTfNet/SampleTfNet/Program.cs:line 3
Reproduction Steps
create new console app with net8.0
runtime
csproj should look as such
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SciSharp.TensorFlow.Redist" Version="2.16.0" />
<PackageReference Include="TensorFlow.Keras" Version="0.15.0" />
<PackageReference Include="TensorFlow.NET" Version="0.150.0" />
</ItemGroup>
</Project>
paste this into Program.cs
:
using static Tensorflow.Binding;
var t = tf;
run project, the exception would be thrown
Known Workarounds
Not found
Configuration and Other Information
SciSharp.TensorFlow.Redist:2.16.0 TensorFlow.Keras:0.15.0 TensorFlow.NET:0.150.0 .net SDK 8.0.100 macOS 14.1