takuya-takeuchi / FaceRecognitionDotNet

The world's simplest facial recognition api for .NET on Windows, MacOS and Linux
MIT License
1.27k stars 308 forks source link

Mac os 11 "libDlibDotNetNativeDnn.dylib" cannot be opened because the developer can not be verified #177

Open khinklenj opened 3 years ago

khinklenj commented 3 years ago

Hi I am getting the following error Mac os 11 "libDlibDotNetNativeDnn.dylib" cannot be opened because the developer can not be verified when running the following code on Visual Studio 2019 mac

Then I get the error Unable to load shared library 'DlibDotNetNativeDnn' or one of its dependencies

private FaceRecognition fr; dir = AppDomain.CurrentDomain.BaseDirectory;

fr = FaceRecognition.Create(dir)

Thank you Keith

Webreaper commented 3 years ago

I get the same error, building the FaceDetection sample on my M1 MacBook pro running 11.2.

Unhandled exception. System.TypeInitializationException: The type initializer for 'DlibDotNet.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'DlibDotNetNativeDnn' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libDlibDotNetNativeDnn, 1): image not found
   at DlibDotNet.NativeMethods.LossMetric_anet_type_create()
   at DlibDotNet.NativeMethods..cctor() in DlibDotNet.dll:token 0x6000a1a+0x2a
   --- End of inner exception stack trace ---
   at DlibDotNet.NativeMethods.get_frontal_face_detector()
   at DlibDotNet.Dlib.GetFrontalFaceDetector() in DlibDotNet.dll:token 0x6000076+0x0
   at FaceRecognitionDotNet.FaceRecognition..ctor(String directory) in FaceRecognitionDotNet.dll:token 0x6000028+0x92
   at FaceDetection.Program.<>c__DisplayClass1_0.<Main>b__0() in /Users/markotway/LocalCloud/Development/FaceDetection/Program.cs:line 76
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args) in Microsoft.Extensions.CommandLineUtils.dll:token 0x6000040+0x335
   at FaceDetection.Program.Main(String[] args) in /Users/markotway/LocalCloud/Development/FaceDetection/Program.cs:line 95
khinklenj commented 3 years ago

@Webreaper if you find a solution please let me know, I am pulling my hair trying to solve this and I dont have much to spare lol

takuya-takeuchi commented 3 years ago

@Webreaper You can use otool -L DlibDotNetNativeDnn.dylib and it should show missing dependencies.

However, I don't have M1 Mac machine and I may not reproduce your issue.

khinklenj commented 3 years ago

Here is what I got when I run the command

libDlibDotNetNativeDnn.dylib: @rpath/libDlibDotNetNativeDnn.dylib (compatibility version 0.0.0, current version 0.0.0) /opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0) /opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0) /opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0) /opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0) /usr/local/opt/giflib/lib/libgif.dylib (compatibility version 0.0.0, current version 7.2.0) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 321.1.0) /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)

I dont know what I am missing

khinklenj commented 3 years ago

@Webreaper were you able to make any progress on your end.

Webreaper commented 3 years ago

No, I gave up and didn't continue investigating. Looking at alternative face-detection libs.

tugbargn commented 1 year ago

Have you ever find a solution about this issue? I have the same issue. I couldn't find a solution.

takuya-takeuchi commented 1 year ago

I have no M1 mac. I can't go through issue. But M1 mac support x86_64 by using Rosseta. So it may work after install Rosetta.