machinelearning icon indicating copy to clipboard operation
machinelearning copied to clipboard

Azure Web App Can't Find "CpuMathNative.dll"

Open eddieysong opened this issue 8 years ago • 3 comments

System information

  • OS version/distro: I'm not quite sure how to find that information on an Azure Web App service
  • .NET Version (eg., dotnet --info): .NET Core 2.0

Issue

  • What did you do? Deploy a web API project that includes ML.NET functionalities to an Azure Web App
  • What happened? When training the model, an exception is thrown because CpuMathNative.dll cannot be found.
  • What did you expect? The same project worked as intended when I tried running it in my local environment, so I expected it to work on Azure too.

Source code / logs

This is the stack trace of the exception:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> 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.SumSqU(Single* ps, Int32 c)
   at Microsoft.ML.Runtime.Learners.SdcaTrainerBase`2.TrainCore(IChannel ch, RoleMappedData data, LinearPredictor predictor, Int32 weightSetCount)
   at Microsoft.ML.Runtime.Learners.StochasticTrainerBase`2.TrainModelCore(TrainContext context)
   at Microsoft.ML.Runtime.Training.TrainerEstimatorBase`2.Train(TrainContext context)
   at Microsoft.ML.Runtime.Training.TrainerEstimatorBase`2.Microsoft.ML.Runtime.ITrainer.Train(TrainContext context)
   at Microsoft.ML.Runtime.Data.TrainUtils.TrainCore(IHostEnvironment env, IChannel ch, RoleMappedData data, ITrainer trainer, RoleMappedData validData, ICalibratorTrainer calibrator, Int32 maxCalibrationExamples, Nullable`1 cacheData, IPredictor inputPredictor)
   at Microsoft.ML.Runtime.EntryPoints.LearnerEntryPointsUtils.Train[TArg,TOut](IHost host, TArg input, Func`1 createTrainer, Func`1 getLabel, Func`1 getWeight, Func`1 getGroup, Func`1 getName, Func`1 getCustom, ICalibratorTrainerFactory calibrator, Int32 maxCalibrationExamples)
   at Microsoft.ML.Runtime.Learners.Sdca.TrainMultiClass(IHostEnvironment env, Arguments input)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.ML.Runtime.EntryPoints.EntryPointNode.Run()
   at Microsoft.ML.Runtime.EntryPoints.EntryPointGraph.RunNode(EntryPointNode node)
   at Microsoft.ML.Runtime.EntryPoints.JsonUtils.GraphRunner.RunAllNonMacros()
   at Microsoft.ML.Runtime.EntryPoints.JsonUtils.GraphRunner.RunAll()
   at Microsoft.ML.LearningPipeline.Train[TInput,TOutput]()
   at LocationAPI.Controllers.APIControllers.MLTestController.<TrainAsync>d__8.MoveNext() in D:\home\site\repository\LocationAPI\Controllers\APIControllers\MLTestController.cs:line 95

eddieysong avatar Nov 01 '18 17:11 eddieysong

What version of ML.Net are you using? From stack trace it's looks like a 0.5 or something even older.

Ivanidzo4ka avatar Nov 01 '18 19:11 Ivanidzo4ka

It is 0.5, a lot of things got moved to Legacy in 0.6, so maybe if I changed my code to the current version it'll work?

On Thu, Nov 1, 2018, 3:42 PM Ivan Matantsev <[email protected] wrote:

What version of ML.Net are you using? From stack trace it's looks like a 0.5 or something even older.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dotnet/machinelearning/issues/1503#issuecomment-435162065, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ1VG4UnuTgH3K8rdxwRkRRj_zCbZo5_ks5uq07CgaJpZM4YHvpf .

eddieysong avatar Nov 01 '18 19:11 eddieysong

I've updated the package to v0.7, and the problem seems to have been solved.

eddieysong avatar Nov 19 '18 20:11 eddieysong