I am trying to make project in .NET framework in which the controller code is as below:
[HttpGet]
public ActionResult Analysis()
{
return View();
}
[HttpPost]
public ActionResult Analysis(ModelInput input)
{
// Load the model
MLContext mlContext = new MLContext();
ITransformer mlModel = mlContext.Model.Load(@"C:\Users\samya\source\repos\riya123\riya123ML.Model\MLModel.zip", out var modelInputSchema);
// Create prediction engine related to the loaded train model
var predEngine = mlContext.Model.CreatePredictionEngine<ModelInput, ModelOutput>(mlModel);
// Input
input.Year = DateTime.Now.Year;
// Try model on sample data and find the score
ModelOutput result = predEngine.Predict(input);
// Store result into ViewBag
ViewBag.Result = result;
return View();
}
And when I try to run it shows error as below although the dll is seen in the solution explorer:
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)