zoukankan      html  css  js  c++  java
  • Winform使用ML.NET时无法加载 DLL“CpuMathNative”问题的解决方法

    同样的代码运行在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目录下复制同名文件,完美解决。

  • 相关阅读:
    解决Windows 7下IE11无法卸载、无法重新安装,提示安装了更新的IE版本
    [SQL Server] 数据库日志文件自动增长导致连接超时的分析
    DataTable转换为List<T>或者DataRow转换为T
    比较Js的substring、substr和C#的Substring
    .NET(c#)Parameters
    SheetJS保存Excel文件
    SheetJS将table转为Excel
    JS中使用let解决闭包
    Font Awesome图标的粗细
    滚动条样式修改
  • 原文地址:https://www.cnblogs.com/sinceret/p/11665523.html
Copyright © 2011-2022 走看看