-
Notifications
You must be signed in to change notification settings - Fork 229
System.TypeInitializationException: The type initializer for 'ViewFaceCore.Native.ViewFaceNative' threw an exception. #93
Description
简明描述
在centos8版本 8.5.211上测试出现上述错误 详细报错信息在下方 最开始是提示系统找不到glicb 2.29 当我从2.28升级成为2.29以后 则提示`GLIBCXX_3.4.26' not found 这就跟无限循环呢 请问该怎么处理 issue 68
已经看过没有很好的思路 该怎么解决呢 谢谢!!!
重现步骤
开发环境
- 目标框架: [e.g. .net452, .netcoreapp3.1, .net5-windows] .net6
- 项目类型 [e.g. 控制台应用, ASP.NET Core API, Windows窗体应用] 控制台应用
相关包清单
viewFaceCore 0.4.0-alpha4
viewfacecore.all_models 6.0.7
viewfacecore.Extension.skiasharp 0.4.0-alpha4
viewfacecore.runtime.ubuntu.22.04.x64 6.07
运行环境
- 操作系统: centos8版本 8.5.211
- 系统类型: 64位
- 处理器: 12th Gen Intel(R) Core(TM) i7-12700
附件
代码如下
static void Main(string[] args)
{
Console.WriteLine("开始运行");
Stopwatch sw = Stopwatch.StartNew();
sw.Start();
using var faceImage0 = SKBitmap.Decode("111.jpg").ToFaceImage();
using var faceImage1 = SKBitmap.Decode("2222.jpg").ToFaceImage();
//检测人脸信息
using FaceDetector faceDetector = new FaceDetector();
FaceInfo[] infos0 = faceDetector.Detect(faceImage0);
FaceInfo[] infos1 = faceDetector.Detect(faceImage1);
//标记人脸位置
using FaceLandmarker faceMark = new FaceLandmarker();
FaceMarkPoint[] points0 = faceMark.Mark(faceImage0, infos0[0]);
FaceMarkPoint[] points1 = faceMark.Mark(faceImage1, infos1[0]);
//提取特征值
using FaceRecognizer faceRecognizer = new FaceRecognizer();
float[] data0 = faceRecognizer.Extract(faceImage0, points0);
float[] data1 = faceRecognizer.Extract(faceImage1, points1);
//对比特征值
bool isSelf = faceRecognizer.IsSelf(data0, data1);
Console.WriteLine($"识别到的人脸是否为同一人:{isSelf},对比耗时:{sw.ElapsedMilliseconds}ms");
Console.WriteLine();
sw.Stop();
}
在centos8上测试报错信息如下
开始运行
Unhandled exception. System.TypeInitializationException: The type initializer for 'ViewFaceCore.Native.ViewFaceNative' threw an exception.
---> System.DllNotFoundException: Unable to load shared library '/home/bbcc/FaceSoft/linux-x64/viewfacecore/linux/x64/libtennis.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /home/bbcc/FaceSoft/linux-x64/viewfacecore/linux/x64/libtennis.so)
at System.Runtime.InteropServices.NativeLibrary.LoadFromPath(String libraryName, Boolean throwOnError)
at System.Runtime.InteropServices.NativeLibrary.Load(String libraryPath)
at ViewFaceCore.Native.ViewFaceNative..cctor()
--- End of inner exception stack trace ---
at ViewFaceCore.Native.ViewFaceNative.GetFaceDetectorHandler(Double faceSize, Double threshold, Double maxWidth, Double maxHeight, Int32 deviceType)
at ViewFaceCore.Core.FaceDetector..ctor(FaceDetectConfig config)
at ConsoleApp1.Program.Main(String[] args) in C:\Users\Administrator\Desktop\UOS\人脸比对linux版本\ConsoleApp1\ConsoleApp1\Program.cs:line 20
已放弃 (核心已转储)