You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System.DllNotFoundException: Unable to load DLL 'CpuMathNative' #333
What did you do?
When trying to load model from a file var model = PredictionModel.ReadAsync<IrisData, IrisPrediction>(modelPath).Result; gives DllNotFoundException while running in windows container.
What happened?
Internal Server Error
What did you expect?
Model should be loaded in model variable.
Source code / logs
System.DllNotFoundException: Unable to load DLL 'CpuMathNative': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Microsoft.ML.Runtime.Internal.CpuMath.Thunk.DotU(Single* pa, Single* pb, Int32 c)
at Microsoft.ML.Runtime.Internal
1000
.CpuMath.SseUtils.DotProductDense(Single[] a, Single[] b, Int32 count)
at Microsoft.ML.Runtime.Learners.MulticlassLogisticRegressionPredictor.PredictCore(VBuffer`1& src, Single[]& dst)
at Microsoft.ML.Runtime.Learners.MulticlassLogisticRegressionPredictor.<GetMapper>b__30_0[TSrc,TDst](VBuffer`1& src, VBuffer`1& dst)
at Microsoft.ML.Runtime.Data.PredictedLabelScorerBase.EnsureCachedPosition[TScore](Int64& cachedPosition, TScore& score, IRow boundRow, ValueGetter`1 scoreGetter)
at Microsoft.ML.Runtime.Data.MultiClassClassifierScorer.<>c__DisplayClass14_0.<GetPredictedLabelGetter>b__0(UInt32& dst)
at Microsoft.ML.Runtime.Data.KeyToValueTransform.KeyToValueMap`2.<>c__DisplayClass7_0.<GetMappingGetter>b__0(TValue& dst)
at Microsoft.ML.Runtime.Data.DataViewUtils.Splitter.Consolidator.<>c__DisplayClass4_1.<ConsolidateCore>b__2()
```Please paste or attach the code or logs or traces that would be helpful to diagnose the issue you are reporting.
Did you run build.cmd before running it? I got this issue & needed to pull the solution down again & rerun build.cmd to be able to correctly build the solution
An AnyCPU assembly will JIT to 64 bit code when loaded into a 64 bit process and 32 bit when loaded into a 32 bit process so no need to change I think - I had this on Windows Server 2016 Standard & reinstalled the tools & all was good
I'm getting something similar with .NET Core 2.1 when trying to run unit tests but changing the project force x64 doesn't seem to work. See stack trace below.
I'm using "dotnet test" to run this.
Environment
C:\BuildAgent\work\50915b32e326b397\Testing\DragnetTech.EmailParsing.Tests>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.300
Commit: adab45bf0c
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.300\
Host (useful for support):
Version: 2.1.0
Commit: caa7b7e2ba
.NET Core SDKs installed:
2.1.101 [C:\Program Files\dotnet\sdk]
2.1.300 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Here is the stack trace.
Test method DragnetTech.EmailParsing.Tests.EmailProcessingTests.MineEmail_GoToMeeting3 threw exception:
System.InvalidOperationException: Splitter/consolidator worker encountered exception while consuming source data ---> System.DllNotFoundException: Unable to load DLL 'CpuMathNative' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Stack Trace:
at Microsoft.ML.Runtime.Internal.CpuMath.Thunk.SumSqU(Single* ps, Int32 c)
at Microsoft.ML.Runtime.Data.LpNormNormalizerTransform.<>c__DisplayClass27_0.<GetGetterCore>b__5(VBuffer`1& dst)
at Microsoft.ML.Runtime.Data.ConcatTransform.<>c__DisplayClass36_0`1.<MakeGetter>b__0(VBuffer`1& dst)
at Microsoft.ML.Runtime.Data.SchemaBindablePredictorWrapperBase.<>c__DisplayClass16_0`2.<GetValueGetter>b__0(TDst& dst)
at Microsoft.ML.Runtime.Data.DataViewUtils.Splitter.Consolidator.<>c__DisplayClass4_1.<ConsolidateCore>b__2()
--- End of inner exception stack trace ---
at Microsoft.ML.Runtime.Data.DataViewUtils.Splitter.Batch.SetAll(OutPipe[] pipes)
at Microsoft.ML.Runtime.Data.DataViewUtils.Splitter.Cursor.MoveNextCore()
at Microsoft.ML.Runtime.Data.RootCursorBase.MoveNext()
at Microsoft.ML.Runtime.Api.PipeEngine`1.RunPipe(Boolean reuseRowObject)+MoveNext()
at Microsoft.ML.PredictionModel`2.Predict(TInput input)
at DragnetTech.EmailParsing.ML.Predictors.PredictLanguageName(String text) in C:\BuildAgent\work\50915b32e326b397\Functions\DragnetTech.EmailParsing\ML\Predictors.cs:line 45
at DragnetTech.EmailParsing.EmailParser.<>c__DisplayClass2_3.<ProcessEmailBodySections>b__9(ILanguage l) in C:\BuildAgent\work\50915b32e326b397\Functions\DragnetTech.EmailParsing\EmailParser.cs:line 233
In my case problem was on some particular machines. The same application was working fine on development ones, but did not work on production environment. Problem was solved by installing Visual C++ Redistributable 2017 on production server.
Exception thrown: 'System.DllNotFoundException' in Microsoft.ML.CpuMath.dll
An exception of type 'System.DllNotFoundException' occurred in Microsoft.ML.CpuMath.dll but was not handled in user code
Unable to load DLL 'CpuMathNative': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Trying to implement sentimental analysis on comments in ASP.NET MVC Web Application(.NET Framework) although it is seen in solution explorer..and have kept solution platform as AnyCPU.Also tried x86 and x64 but no change.
The error is pointing at this line:
ModelOutput result = predEngine.Predict(input);
Activity
jusso-dev commentedon Jun 10, 2018
Change your project to compile to 64x, CpuMathNative is a 64x run time dependant library
chrismckelt commentedon Jun 22, 2018
Did you run build.cmd before running it? I got this issue & needed to pull the solution down again & rerun build.cmd to be able to correctly build the solution
jusso-dev commentedon Jun 23, 2018
That's probably solving the same issue. If building the project outside of a 64x runtime it won't work, point blank.
chrismckelt commentedon Jun 25, 2018
An AnyCPU assembly will JIT to 64 bit code when loaded into a 64 bit process and 32 bit when loaded into a 32 bit process so no need to change I think - I had this on Windows Server 2016 Standard & reinstalled the tools & all was good
PaulDMendoza commentedon Aug 29, 2018
I'm getting something similar with .NET Core 2.1 when trying to run unit tests but changing the project force x64 doesn't seem to work. See stack trace below.
I'm using "dotnet test" to run this.
Environment
Here is the stack trace.
PaulDMendoza commentedon Aug 29, 2018
Actually, this issue/comment resolved my problem. Had to install the Visual Studio C++ update.
#605 (comment)
Ivanidzo4ka commentedon Oct 18, 2018
DRI RESPONSE: This issue looks like answered. I'm planning to close it within few days, if no one object to that.
Finansnet commentedon Nov 18, 2018
In my case problem was on some particular machines. The same application was working fine on development ones, but did not work on production environment. Problem was solved by installing Visual C++ Redistributable 2017 on production server.
Marek
Telemetry2 (dotnet#333)
code migration from machinelearning-automl to machinelearning repo fe…
Telemetry2 (dotnet#333)
Added onnx export functionality for LpNormNormalizingTransformer (#4161)
Added Onnx export functionality to PCATransformer (#4188)
samcode22 commentedon Nov 16, 2019
Exception thrown: 'System.DllNotFoundException' in Microsoft.ML.CpuMath.dll
An exception of type 'System.DllNotFoundException' occurred in Microsoft.ML.CpuMath.dll but was not handled in user code
Unable to load DLL 'CpuMathNative': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Trying to implement sentimental analysis on comments in ASP.NET MVC Web Application(.NET Framework) although it is seen in solution explorer..and have kept solution platform as AnyCPU.Also tried x86 and x64 but no change.
The error is pointing at this line:
ModelOutput result = predEngine.Predict(input);
ArnieBerg commentedon Mar 14, 2020
See #4870.