takuya-takeuchi / FaceRecognitionDotNet

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

Exception loading models. #12

Closed ChrisKarle closed 6 years ago

ChrisKarle commented 6 years ago

It appears that the library is unable to load the models.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B) at DlibDotNet.FrontalFaceDetector.Native.get_frontal_face_detector() at FaceRecognitionDotNet.FaceRecognition..ctor(String directory) at FaceRecognitionDotNet.FaceRecognition.Create(String directory) at Temp.Form1.Form1_Shown(Object sender, EventArgs e) in C:\Users\Chris\Desktop\Temp\Temp\Form1.cs:line 47 at System.Windows.Forms.Form.OnShown(EventArgs e) at System.Windows.Forms.Form.CallShownEvent() at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

** Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.7.3163.0 built by: NET472REL1LAST_C CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

Temp Assembly Version: 1.0.0.0 Win32 Version: 1.0.0.0 CodeBase: file:///C:/Users/Chris/Desktop/Temp/Temp/bin/Debug/Temp.exe

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.7.3151.0 built by: NET472REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.7.3160.0 built by: NET472REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.7.3056.0 built by: NET472REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

FaceRecognitionDotNet Assembly Version: 1.2.3.4 Win32 Version: 1.2.3.4 CodeBase: file:///C:/Users/Chris/Desktop/Temp/Temp/bin/Debug/FaceRecognitionDotNet.DLL

netstandard Assembly Version: 2.0.0.0 Win32 Version: 4.7.3056.0 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/netstandard/v4.0_2.0.0.0__cc7b13ffcd2ddd51/netstandard.dll

DlibDotNet Assembly Version: 19.15.0.0 Win32 Version: 19.15.0.0 CodeBase: file:///C:/Users/Chris/Desktop/Temp/Temp/bin/Debug/DlibDotNet.DLL

** JIT Debugging ** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

takuya-takeuchi commented 6 years ago

DlibDotNet support only 64bit. So you must specify 64bit architecture for your application uses FaceRecognitionDotNet.

Pkease checj project config.

ChrisKarle commented 6 years ago

That was it! Thank you!!!