首页 > Windows开发 > 详细

Winform使用ML.NET时无法加载 DLL“CpuMathNative”问题的解决方法

时间:2019-10-13 12:16:50      阅读:130      评论:0      收藏:0      [点我收藏+]

同样的代码运行在netcore下可以,运行在winform中就出现错误:

引发的异常:“System.DllNotFoundException”(位于 Microsoft.ML.Data.dll 中)

跟进代码,发现异常为:

Message = "无法加载 DLL“CpuMathNative”: 找不到指定的模块。 (异常来自 HRESULT:0x8007007E)。"

Source = "Microsoft.ML.CpuMath"

STACK TRACK:

在 Microsoft.ML.Internal.CpuMath.Thunk.DotSU(Single* pa, Single* pb, Int32* pi, Int32 c)
在 Microsoft.ML.Numeric.VectorUtils.DotProduct(VBuffer`1& a, VBuffer`1& b)
在 Microsoft.ML.Trainers.LinearMulticlassModelParametersBase.PredictCore(VBuffer`1& src, VBuffer`1& dst)
在 Microsoft.ML.Data.PredictedLabelScorerBase.EnsureCachedPosition[TScore](Int64& cachedPosition, TScore& score, DataViewRow boundRow, ValueGetter`1 scoreGetter)
在 Microsoft.ML.Data.MulticlassClassificationScorer.<>c__DisplayClass16_0.<GetPredictedLabelGetter>b__0(UInt32& dst)
在 Microsoft.ML.Transforms.KeyToValueMappingTransformer.Mapper.KeyToValueMap`2.<>c__DisplayClass8_0.<GetMappingGetter>b__0(TValue& dst)
在 Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.<>c__DisplayClass10_0`1.<CreateDirectSetter>b__0(TRow row)
在 Microsoft.ML.Data.TypedCursorable`1.TypedRowBase.FillValues(TRow row)
在 Microsoft.ML.PredictionEngineBase`2.Predict(TSrc example)
...................................

百度了很久无法解决,没办法,还得上google啊,

解决方法在此:

https://github.com/dotnet/machinelearning-samples/issues/274

技术分享图片

 

 我的是x64自然要去win-x64目录下复制同名文件,完美解决。

Winform使用ML.NET时无法加载 DLL“CpuMathNative”问题的解决方法

原文:https://www.cnblogs.com/sinceret/p/11665523.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!