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

[BUG Report]: Cannot find backend on Apple Silicon mac #1236

Open
ronimizy opened this issue Feb 22, 2024 · 1 comment
Open

[BUG Report]: Cannot find backend on Apple Silicon mac #1236

ronimizy opened this issue Feb 22, 2024 · 1 comment

Comments

@ronimizy
Copy link

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

@DavidPeralta36
Copy link

I have the same error but I have a solution with WPF application, I am trying to call tf and I am getting the same (yes, i have SciSharp.TensorFlow.Redist installed)

Configuration and Other Information
SciSharp.TensorFlow.Redist:2.16.0
TensorFlow.Keras:0.15.0
TensorFlow.NET:0.150.0

Win 11

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

2 participants