SciSharp / TensorFlow.NET

.NET Standard bindings for Google's TensorFlow for developing, training and deploying Machine Learning models in C# and F#.
https://scisharp.github.io/tensorflow-net-docs
Apache License 2.0
3.17k stars 507 forks source link

[BUG Report]: SciSharp.TensorFlow.Redist nuget packages missing OSX binaries #1141

Closed puddlejumper9 closed 1 year ago

puddlejumper9 commented 1 year ago

Description

I doubt this is the right place for this but it's the best I could find.

I'm trying to use TF.NET nuget package and everything is fine except the SciSharp.TensorFlow.Redist nuget package is missing the binaries for OSX. Both the Windows and Linux binaries seem to be present.

Screenshot 2023-07-09 at 2 46 21 PM

Mac Homebrew doesn't have the correct binary version, and the default pip package is 2.12 which is missing a symbol that TF.NET tried to load. Currently working to force pip to use TF version 2.11.0

Reproduction Steps

  1. Use a Mac
  2. Create dotnet core project.
  3. Add TF.NET and SciSharp.TensorFlow.Redist nuget packages.
  4. Run code that uses the library.

Known Workarounds

Downloading binaries somewhere other than the SciSharp.TensorFlow.Redist nuget package. Compiling TF from source.

Configuration and Other Information

On OSX "SciSharp.TensorFlow.Redist" Version="2.11.0" "TensorFlow.Keras" Version="0.11.0" "TensorFlow.NET" Version="0.110.0" TargetFramework net7.0

Wanglongzhi2001 commented 1 year ago

Hello, since there are relatively few developers in tf.net, the developer who was responsible for compiling at that time did not have a computer with a macos system, and there are relatively few macos users on tf.net, so the macos version has not been compiled since 2.11. Sorry for the inconvenience.

puddlejumper9 commented 1 year ago

Ah ok no worries. Thank you for the quick response. If there's anything I can do to help provide this I'd be more than happy just let me know.

Wanglongzhi2001 commented 1 year ago

Thank you for your enthusiasm and attention to TensorFlow.NET. If you can participate in the development of TensorFlow.NET, TensorFlow.NET will definitely become better. BTW, you can join our discord channel or QQ group to get in touch with us more closely. ^_^

Oceania2018 commented 1 year ago

@puddlejumper9 @Wanglongzhi2001 Good news @AsakusaRinne just compiled the library for mac os. You can download from this link. Please keep us updated if the library works or not.

puddlejumper9 commented 1 year ago

@Oceania2018 dlopen(/Users/nolans/source/repos/ML Chess/EngineTest/bin/Debug/net7.0/runtimes/osx-x64/native/libtensorflow.dylib, 0x0001): tried: '/Users/nolans/source/repos/ML Chess/EngineTest/bin/Debug/net7.0/runtimes/osx-x64/native/libtensorflow.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h' or 'x86_64'))

It seems this binary in osx-x64 folder is for arm64 architecture. This should be in the osx-arm64 folder.

So the issue persists. Now have osx-arm64 binaries, but lacking osx-x64 binaries.

Lesiuk commented 10 months ago

@puddlejumper9 @Wanglongzhi2001 Good news @AsakusaRinne just compiled the library for mac os. You can download from this link. Please keep us updated if the library works or not.

Something is wrong with this nuget package. Arm64 runtime is inside x64 directory. It does not work.

jambudipa commented 8 months ago

@puddlejumper9 @Wanglongzhi2001 Good news @AsakusaRinne just compiled the library for mac os. You can download from this link. Please keep us updated if the library works or not.

Something is wrong with this nuget package. Arm64 runtime is inside x64 directory. It does not work.

I am suffering the same problem on macOS, Tensorflow.NET cannot find a backend.

Is there a means to compile this from source code and use it in my own app? .NET was my daily bread and butter for many years, but I haven't done it in nearly a decade!

I have added the Tensorflow.Binding and Tensorflow.Keras projects from the repo to my own solution, but it still complains about the SciSharp.TensorFlow.Redist package.

How do I include this in my solution, if I intend to compile it from source?