-
Notifications
You must be signed in to change notification settings - Fork 21
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
Image classification fails on M1 chip Macs #9
Comments
Hi @justinphamnz, Thanks for the issue report. Is it possible for you to post the code extract of how you're using NsfwSpy please? I've just tried using NsfwSpy on a Mac as part of a console application just now and it worked OK classifying a web image. Can you also confirm you are using version 2.3.1 of SciSharp.TensorFlow.Redist? Cheers 😊 |
Hi @d00ML0rDz, Thanks for looking into the issue. Here is the basic Console App that I tried to implement https://github.com/justinphamnz/Console-NSFW I think the issue could be with Apple M1 chip, not so sure if you or anyone has experienced this before. I can confirm that I installed SciSharp.TensorFlow.Redist 2.3.1. Have a great day. |
Hi @justinphamnz, That code extract all looks OK and I would expect that to work. The Apple M1 chip may be the issue here although as far as I'm aware ML.NET does support Apple's silicon and has done since 1.6.0. It's possible one of the dependencies we are using isn't playing ball. Would you be happy to wrap the code extract you sent me in a try catch block like this and see if it writes out an error message please?
I unfortunately don't have access to an M1 Mac myself so testing this will be a challenge, but I can confirm the code extract does run fine on an Intel based Mac Mini. Cheers |
Thanks @d00ML0rDz, I did wrap the try-catch and seems there is no catch hit using Visual Studio Code. I then installed Visual Studio 2022 for Mac, and was able to catch the Inner Exception
|
I've just found this StackOverflow thread that seems to describe your issue, however it sounds like the solution was to use .NET 5 and I can see you're already using .NET 6 so suspect that won't work. I also found this GitHub comment which makes me wonder if including the SciSharp.TensorFlow.Redist GPU packages for Windows and Linux by default is interfering in some way. You could try cloning the NsfwSpy repo and in the NsfwSpy project removing the following package references:
and replacing them with:
You should then be able to add a new console application to the solution that references that modified version of NsfwSpy and see if your code extract now runs correctly. If that does work, I can work out a solution, maybe two separate Nuget packages, one for GPU and one for CPU. Sorry this isn't a quick fix! |
Thanks @d00ML0rDz. That's super helpful. Really appreciate your prompt response. Looking forward to contributing to this wonderful project. |
@justinphamnz just done some more research and found this Reddit post where the author said they had some luck using the In the comments of that post someone also commented this document saying that TensorFlow isn't supported on M1 Macs yet when using ML.NET, so that might be why it's currently not working 😕 Would love for you to help on the project if you're able to find a way to get it working though! |
Hi Keep up the amazing work! |
@Halfooda We have a page on our wiki that mentions CPUs must support AVX for this library, which from a quick google, sounds like the Raspberry Pi doesn't 😕 Don't think it will be possible to get this running unfortunately. |
Thanks for a great work. I just tried to add this package to my test C# API and failed to run it on MacOS Monterey.
After successfully adding to our project, when the code hit NSFW Spy, it exits immediately without any error. Any tips would be appreciated.
SciSharp.TensorFlow.Redist
.NET SDK
Version: 6.0.105
Commit: 1c35735293
Runtime Environment:
OS Name: Mac OS X
OS Version: 12.4
OS Platform: Darwin
RID: osx.12-x64
Base Path: /usr/local/share/dotnet/x64/sdk/6.0.105/
Host (useful for support):
Version: 6.0.5
Commit: 70ae3df4a6
.NET SDKs installed:
3.1.419 [/usr/local/share/dotnet/x64/sdk]
5.0.408 [/usr/local/share/dotnet/x64/sdk]
6.0.105 [/usr/local/share/dotnet/x64/sdk]
The text was updated successfully, but these errors were encountered: