Git Product home page Git Product logo

Comments (11)

takuya-takeuchi avatar takuya-takeuchi commented on May 26, 2024

takuya-takeuchi/FaceRecognitionDotNet#4

from dlibdotnet.

takuya-takeuchi avatar takuya-takeuchi commented on May 26, 2024

This is not bug. It can improve by linking Intel MKL to DlibDotNet.Native.Dnn.dll.

from dlibdotnet.

yuzifu avatar yuzifu commented on May 26, 2024

Do I need to compile myself from the source code? Does the version installed from nuget.org use MKL?

from dlibdotnet.

takuya-takeuchi avatar takuya-takeuchi commented on May 26, 2024

Yes. Intel MKL are distributed from intel web site.
You must do user registration to download it.

And do compile DlibDotNet.Native.Dnn with Inte MKL.
The following is sample CMake command

set CURDIR=%cd%
set DIRLINK=build_cpu
mkdir %DIRLINK%
cd %DIRLINK%
set DLIBVER=19.15
set INTEL_MKL=D:/Works/Lib/Intel/Math Kernel Library/2019.0.117/Windows/windows
cmake -G "Visual Studio 15 2017 Win64" -T host=x64 ^
           -DDLIB_PATH=D:/Works/Lib/DLib/%DLIBVER% ^
           -DUSE_AVX_INSTRUCTIONS=ON ^
           -DUSE_SSE2_INSTRUCTIONS=ON ^
           -DUSE_SSE4_INSTRUCTIONS=ON ^
           -DLIB_USE_BLAS=ON ^
           -DBLAS_libiomp5md_LIBRARY="%INTEL_MKL%/compiler/lib/intel64_win/libiomp5md.lib" ^
           -DBLAS_mkl_core_dll_LIBRARY="%INTEL_MKL%/mkl/lib/intel64_win/mkl_core_dll.lib" ^
           -DBLAS_mkl_intel_lp64_dll_LIBRARY="%INTEL_MKL%/mkl/lib/intel64_win/mkl_intel_lp64_dll.lib" ^
           -DBLAS_mkl_intel_thread_dll_LIBRARY="%INTEL_MKL%/mkl/lib/intel64_win/mkl_intel_thread_dll.lib" ^
           ..
cmake --build . --config %1

from dlibdotnet.

takuya-takeuchi avatar takuya-takeuchi commented on May 26, 2024

But it may be easy after you install intel MKL to system.
Because dlib provides find_blas.cmake to link Intel MKL.
https://github.com/davisking/dlib/blob/master/dlib/cmake_utils/find_blas.cmake

However, I did not use it, so I do not know it works.

from dlibdotnet.

yuzifu avatar yuzifu commented on May 26, 2024

tks!

from dlibdotnet.

yuzifu avatar yuzifu commented on May 26, 2024

I compiled DlibDotNet.Native.Dnn with MKL from source(19.15.0.20180916, commit-d7e71be), DlibDotnet and DlibDotNet.Native from nuget, but they didn't work with benchmark. The error message is as follows:

dotnet run -c Release -- "-m=Models"

Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'DlibDotNet.Native.Dnn.dll' or one of its dependencies: The specified module could not be found。 (Exception from HRESULT: 0x8007007E)
   at DlibDotNet.Dnn.LossMmod.Native.loss_mmod_deserialize(Byte[] fileName, Int32 type)
   at DlibDotNet.Dnn.LossMmod.Deserialize(String path, Int32 networkType) in D:\MyDoc\Desktop\Projects\STB\FaceRecognitionDotNet\DlibDotNet\src\DlibDotNet\Dnn\LossMmod.cs:line 65
   at FaceRecognitionDotNet.FaceRecognition..ctor(String directory) in D:\MyDoc\Desktop\Projects\STB\FaceRecognitionDotNet\src\FaceRecognitionDotNet\FaceRecognition.cs:line 71
   at Benchmark.Program.<>c__DisplayClass1_0.<Main>b__0() in D:\MyDoc\Desktop\Projects\STB\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 50
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Benchmark.Program.Main(String[] args) in D:\MyDoc\Desktop\Projects\STB\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 83

compile script as following:

set CURDIR=%cd%
set DIRLINK=build_cpu
mkdir %DIRLINK%
cd %DIRLINK%
set DLIBVER=19.15
set INTEL_MKL=D:/IntelSWTools/compilers_and_libraries_2019.0.117/windows
cmake -G "Visual Studio 15 2017 Win64" -T host=x64 ^
           -DDLIB_PATH=D:/MyDoc/Desktop/Projects/STB/dlib-19.15 ^
           -DUSE_AVX_INSTRUCTIONS=ON ^
           -DUSE_SSE2_INSTRUCTIONS=ON ^
           -DUSE_SSE4_INSTRUCTIONS=ON ^
           -DLIB_USE_BLAS=ON ^
           -DBLAS_libiomp5md_LIBRARY="%INTEL_MKL%/compiler/lib/intel64_win/libiomp5md.lib" ^
           -DBLAS_mkl_core_dll_LIBRARY="%INTEL_MKL%/mkl/lib/intel64_win/mkl_core_dll.lib" ^
           -DBLAS_mkl_intel_lp64_dll_LIBRARY="%INTEL_MKL%/mkl/lib/intel64_win/mkl_intel_lp64_dll.lib" ^
           -DBLAS_mkl_intel_thread_dll_LIBRARY="%INTEL_MKL%/mkl/lib/intel64_win/mkl_intel_thread_dll.lib" ^
           ..
cmake --build . --config %1

If I use DlibDotNet.Native.Dnn from nuget, they are work well.
Is there a problem in my compile script?

from dlibdotnet.

takuya-takeuchi avatar takuya-takeuchi commented on May 26, 2024

Intel MKL library is not source code. It means that you must deploy Intel MKL library dll (or so) files.
I deployed the following libraries.

  • libimalloc.dll
  • libiomp5md.dll
  • mkl_avx.dll
  • mkl_avx2.dll
  • mkl_avx512.dll
  • mkl_avx512_mic.dll
  • mkl_blacs_ilp64.dll
  • mkl_blacs_intelmpi_ilp64.dll
  • mkl_blacs_intelmpi_lp64.dll
  • mkl_blacs_lp64.dll
  • mkl_blacs_mpich2_ilp64.dll
  • mkl_blacs_mpich2_lp64.dll
  • mkl_blacs_msmpi_ilp64.dll
  • mkl_blacs_msmpi_lp64.dll
  • mkl_cdft_core.dll
  • mkl_core.dll
  • mkl_def.dll
  • mkl_intel_thread.dll
  • mkl_mc.dll
  • mkl_mc3.dll
  • mkl_msg.dll
  • mkl_pgi_thread.dll
  • mkl_rt.dll
  • mkl_scalapack_ilp64.dll
  • mkl_scalapack_lp64.dll
  • mkl_sequential.dll
  • mkl_tbb_thread.dll
  • mkl_vml_avx.dll
  • mkl_vml_avx2.dll
  • mkl_vml_avx512.dll
  • mkl_vml_avx512_mic.dll
  • mkl_vml_cmpt.dll
  • mkl_vml_def.dll
  • mkl_vml_mc.dll
  • mkl_vml_mc2.dll
  • mkl_vml_mc3.dll
  • tbb.dll
  • tbbmalloc.dll
  • tbbmalloc_proxy.dll

These should be <IntelMKLLibrary_dir>\Windows\windows\redist\intel64_win*.

from dlibdotnet.

takuya-takeuchi avatar takuya-takeuchi commented on May 26, 2024

Perhaps, we need not to deploy all these dll. But I do not know which binary is unnecessary.

from dlibdotnet.

yuzifu avatar yuzifu commented on May 26, 2024

It requires these libraries:

  • libiomp5md.dll
  • mkl_core.dll
  • mkl_def.dll
  • mkl_intel_thread.dll

from dlibdotnet.

takuya-takeuchi avatar takuya-takeuchi commented on May 26, 2024

thanks

from dlibdotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.