Open git-Charlie opened 2 years ago
<PackageReference Include="FaceRecognitionDotNet" Version="1.3.0.6" />
This property is not necessary. Could you remove it and try again?
<PackageReference Include="FaceRecognitionDotNet" Version="1.3.0.6" />
This property is not necessary. Could you remove it and try again?
Thank you for your reply,
When I remove this property
System.TypeInitializationException: The type initializer for 'DlibDotNet.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'DlibDotNetNativeDnn' or one of its dependencies
So I manually copied the file "DlibDotNetNative.dll" and "DlibDotNetNativeDnn.dll" to the program directory.
The execution result is the same as before, no change.
@git-Charlie
I tried benchmark with cnn. Before this, I added FRDN.CUDA111 by using `dotnet add pacakge. Next, I copied cudnn these libs and DlibDotNetNativeDnn.dll from DlibDotNet.CUDA111.
Then
>dotnet run -c Release -- -c -m=D:\Works\OpenSource\FaceRecognitionDotNet.Models
[D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Benchmark.csproj]
Benchmarks
Timings at 240p:
- Face locations: 0.0180s (55.56 fps)
- Face landmarks: 0.0014s (714.29 fps)
- Encode face (inc. landmarks): 0.0040s (250.00 fps)
- End-to-end: 0.0226s (44.25 fps)
Timings at 480p:
Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'cuda_cudaDriverGetVersion' in DLL 'DlibDotNetNativeDnn'.
at DlibDotNet.NativeMethods.dnn_cuda_cudaDriverGetVersion(Int32& version)
at DlibDotNet.Dnn.Cuda.ThrowCudaException(ErrorType error)
at DlibDotNet.Dnn.LossMmod.Operator[T](IEnumerable`1 images, UInt64 batchSize)
at FaceRecognitionDotNet.Dlib.Python.CnnFaceDetectionModelV1.Detect(LossMmod net, Image image, Int32 upsampleNumTimes)
at FaceRecognitionDotNet.FaceRecognition.FaceLocations(Image image, Int32 numberOfTimesToUpsample, Model model)
at Benchmark.Program.TestLocateFaces(Image image) in D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 167
at Benchmark.Program.<>c__DisplayClass3_0`1.<RunTest>b__0() in D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 100
at Benchmark.Program.<>c__DisplayClass3_0`1.<RunTest>b__1(Int32 i) in D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 107
at System.Linq.Enumerable.SelectIPartitionIterator`2.MoveNext()
at System.Linq.Enumerable.Min(IEnumerable`1 source)
at Benchmark.Program.RunTest[T](String path, Func`2 setup, Action`1 test, Int32 iterationsPerTest, Int32 testsToRun, Boolean useCnn) in D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 107
at Benchmark.Program.<>c__DisplayClass2_0.<Main>b__0() in D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 73
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Benchmark.Program.Main(String[] args) in D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Program.cs:line 88
Program crashed but CNN works. I have to fix it.
And Hog mode
>dotnet run -c Release -- -m=D:\Works\OpenSource\FaceRecognitionDotNet.Models[D:\Works\OpenSource\FaceRecognitionDotNet\examples\Benchmark\Benchmark.csproj]
Benchmarks
Timings at 240p:
- Face locations: 0.0482s (20.75 fps)
- Face landmarks: 0.0014s (714.29 fps)
- Encode face (inc. landmarks): 0.0044s (227.27 fps)
- End-to-end: 0.0528s (18.94 fps)
Timings at 480p:
Just in case, I confirmed CUDA_PATH.
>set CUDA
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2
CUDA_PATH_V10_0=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
CUDA_PATH_V10_1=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1
CUDA_PATH_V10_2=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2
CUDA_PATH_V11_0=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0
CUDA_PATH_V11_1=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1
CUDA_PATH_V11_2=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2
CUDA_PATH_V11_3=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3
CUDA_PATH_V11_6=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6
CUDA_PATH_V9_0=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0
CUDA_PATH_V9_1=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1
CUDA_PATH_V9_2=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2
So CUDA_PATH does not afffect behaviors of program if proper libraries are present.
Does your machine recognize gpu?
Thank you for your reply. I reinstalled
Now it works normally. Compared with your previous replies, I found that I was missing 2 files cublas64_11.dll and cublasLt64_11.dll
after that , "Program crashed but CNN works."
but FaceDetection, if Hog is changed to CNN, still unusually slow. It
Benchmarks
Timings at 240p:
- Face locations: 0.0224s (44.64 fps)
- Face landmarks: 0.0032s (312.50 fps)
- Encode face (inc. landmarks): 0.0050s (200.00 fps)
- End-to-end: 0.0274s (36.50 fps)
Timings at 480p:
Unhandled Exception: DlibDotNet.CudaException: Exception of type 'DlibDotNet.CudaException' was thrown.
at DlibDotNet.Dnn.Cuda.ThrowCudaException(ErrorType error)
at DlibDotNet.Dnn.LossMmod.Operator[T](IEnumerable`1 images, UInt64 batchSize)
at FaceRecognitionDotNet.Dlib.Python.CnnFaceDetectionModelV1.Detect(LossMmod net, Image image, Int32 upsampleNumTimes)
at FaceRecognitionDotNet.FaceRecognition.FaceLocations(Image image, Int32 numberOfTimesToUpsample, Model model)
at Benchmark.Program.TestLocateFaces(Image image) in A:\learn\FaceRecognitionDotNet-master\examples\Benchmark\Program.cs:line 166
at Benchmark.Program.<>c__DisplayClass3_0`1.<RunTest>b__0() in A:\learn\FaceRecognitionDotNet-master\examples\Benchmark\Program.cs:line 100
at System.Linq.Enumerable.SelectIPartitionIterator`2.MoveNext()
at System.Linq.Enumerable.Min(IEnumerable`1 source)
at Benchmark.Program.RunTest[T](String path, Func`2 setup, Action`1 test, Int32 iterationsPerTest, Int32 testsToRun, Boolean useCnn) in A:\learn\FaceRecognitionDotNet-master\examples\Benchmark\Program.cs:line 107
at Benchmark.Program.<>c__DisplayClass2_0.<Main>b__0() in A:\learn\FaceRecognitionDotNet-master\examples\Benchmark\Program.cs:line 73
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Benchmark.Program.Main(String[] args) in A:\learn\FaceRecognitionDotNet-master\examples\Benchmark\Program.cs:line 88
use cuda92 and cnn mode, about 1s,,,Can you compile a cuda115? TKS!!
@bigorange1900
Unhandled Exception: DlibDotNet.CudaException: Exception of type 'DlibDotNet.CudaException' was thrown.
Could you check content of CudaException? CudaException has detail message and error code to inspect problem.
dotnet --version 6.0.200 CPU: AMD Ryzen 7 1700x 8 core GPU: NVIDIA GeForce GTX 1080, Driver version 30.0.14.7212 CUDA v11.1
FaceRecognitionDotNet-master\examples\Benchmark>
This is without using CNN
dotnet run -c Release -- "-m=models"
this is proj file
file in models
this is File in \Benchmark\bin\x64\Release\netcoreapp2.0
the cudnn files, I copy from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.1**
v11.1 is the only version on my computer.
when use CNN, It took about half an hour to show these
In project FaceDetection, if Hog is changed to CNN, it will also be unusually slow. It takes about twenty times the time of Hog.
In Task Manager, the CPU usage at runtime is about 8%, GPU is zero.
I don't know if I need to provide any more information, please help me, thanks.