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
Microsoft.ML NuGet package doesn't work with packages.config #93
System.Reflection.TargetInvocationException
HResult=0x80131604
Message=Eccezione generata dalla destinazione di una chiamata.
Source=mscorlib
StackTrace:
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.TrainTInput,TOutput
at IrsiExample.Program.Main(String[] args) in C:\Users\gvolpi\source\repos\MLNetTest1\IrsiExample\Program.cs:line 69
Inner Exception 1:
TargetInvocationException: Eccezione generata dalla destinazione di una chiamata.
Inner Exception 2:
DllNotFoundException: Impossibile caricare la DLL 'CpuMathNative': Impossibile trovare il modulo specificato. (Eccezione da HRESULT: 0x8007007E).
Can you give some more insight in how you referenced ML.NET? Did you use a <PackageReference Include="Microsoft.ML" Version="0.1.0" /> in your .csproj?
Are you on the desktop .NET Framework? If so, you need to switch your project to be built for x64 architecture. Currently, ML.NET only supports x64 processes since we have some C++ native code (the "CpuMathNative" assembly from above) and are only building it for x64 currently.
Reacted by Anders, Xiaoyun Zhang and Juan Carlos Pujol Mainegra
Hi @eerhardt , I have done the test creating a desktop C# project for a CLI application. I have then inluded Microsoft.ML using NuGet and the csproj is slightly different but I am not sure this is relevant:
@guivo, Thanks for checking. Looks like the process fails to find the cpuMathNative.dll. Can you check that the file is in the same location as other managed DLLs and the exe? If it is not in the target directory, then it's likely a problem with our NuGet definition. To unblock yourself, you can copy that file there manually for now.
@guivo - I get your issue now. The problem is that you are using packages.config. Can you switch it to use <PackageReference> instead? This blog shows how easy it is to switch:
I haven't tried getting it to work, but it seems simple enough to fix Microsoft.ML to work with packages.config. So I'd hope we can fix it in the next release.
With regard to this thread, I would to mention that in the case a solution with 3 projects, the recipe I have used (Migrating to PackageReference) didn't have positive effect in the last project. Where the migration seemed successful but the runtime error about not finding CpuMathNative appears.
Same code, in a solution with only that project, everything worked.
The 1st Workaround was not alllowed so tried 2nd adding the code in .csproj but no effect.In Packages folder CpuMathNative.dll is seen but still the error continues.Dont know why it is not able to find.
I am getting the same error but on different scenario. I have 2 input fields one is string and one is int/float. If I am setting only text attribute to my model it is working fine, but when I set int its giving that Microsoft.ML.CpuMathNatiive.dll not loaded error. I am running on x64 mode using ML 1.4.0
Please suggest and provide sample code.
I am trying to consume this model in a service and getting this error.
I think the problem will be solved in the next version, temporarily type
--" Install-Package Microsoft.ML -Version 1.5.0-preview "--
and run it in the package manager
Activity
eerhardt commentedon May 9, 2018
Hi @guivo,
Can you give some more insight in how you referenced ML.NET? Did you use a
<PackageReference Include="Microsoft.ML" Version="0.1.0" />in your .csproj?Are you on the desktop .NET Framework? If so, you need to switch your project to be built for
x64architecture. Currently, ML.NET only supportsx64processes since we have some C++ native code (the "CpuMathNative" assembly from above) and are only building it for x64 currently.guivo commentedon May 9, 2018
Hi @eerhardt , I have done the test creating a desktop C# project for a CLI application. I have then inluded Microsoft.ML using NuGet and the csproj is slightly different but I am not sure this is relevant:
<Reference Include="Microsoft.ML, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL"> <HintPath>..\packages\Microsoft.ML.0.1.0\lib\netstandard2.0\Microsoft.ML.dll</HintPath> </Reference>More lines are there, to refence other ML modules (Api, Core, CpuMath....)
I can confirm that I am targeting x64 (visual studio fails if try a different architecture).
glebuk commentedon May 9, 2018
@guivo, Thanks for checking. Looks like the process fails to find the cpuMathNative.dll. Can you check that the file is in the same location as other managed DLLs and the exe? If it is not in the target directory, then it's likely a problem with our NuGet definition. To unblock yourself, you can copy that file there manually for now.
Regards.
eerhardt commentedon May 9, 2018
@guivo - I get your issue now. The problem is that you are using
packages.config. Can you switch it to use<PackageReference>instead? This blog shows how easy it is to switch:https://blog.nuget.org/20180409/migrate-packages-config-to-package-reference.html
You can also make
PackageReferenceyour default experience in VS following this blog.[-]Impossible to run Iris classification test[/-][+]Microsoft.ML NuGet package doesn't work with packages.config[/+]eerhardt commentedon May 9, 2018
Renaming the issue to best reflect the problem.
Guidance from the NuGet team is:
guivo commentedon May 11, 2018
@eerhardt migrating to PackageReference fixed the issue, thanks!
Should I however expect a more flexible approach in the next release of the package?
eerhardt commentedon May 11, 2018
I haven't tried getting it to work, but it seems simple enough to fix Microsoft.ML to work with packages.config. So I'd hope we can fix it in the next release.
Support packages.config
guivo commentedon May 16, 2018
With regard to this thread, I would to mention that in the case a solution with 3 projects, the recipe I have used (Migrating to PackageReference) didn't have positive effect in the last project. Where the migration seemed successful but the runtime error about not finding CpuMathNative appears.
Same code, in a solution with only that project, everything worked.
eerhardt commentedon May 16, 2018
@guivo - if you could share a .zip (or push to a repo) of a solution that reproduces the issue, I can take a look.
BTW - #165 will fix this issue and allow ML.NET to work with packages.config. So the next release won't require PackageReference.
6 remaining items
CpuMathNative assembly is not getting copied when using packages.config.
CpuMathNative assembly is not getting copied when using packages.conf…
Squashed commit of the following:
samcode22 commentedon Nov 17, 2019
The 1st Workaround was not alllowed so tried 2nd adding the code in .csproj but no effect.In Packages folder CpuMathNative.dll is seen but still the error continues.Dont know why it is not able to find.
Squashed commit of the following:
Fixes onnx exports for binary classification trainers (#4463)
coderdipti commentedon Dec 19, 2019
I am getting the same error but on different scenario. I have 2 input fields one is string and one is int/float. If I am setting only text attribute to my model it is working fine, but when I set int its giving that Microsoft.ML.CpuMathNatiive.dll not loaded error. I am running on x64 mode using ML 1.4.0
Please suggest and provide sample code.
I am trying to consume this model in a service and getting this error.
coderdipti commentedon Dec 19, 2019
@samcode22 Is your issue solved?
eerhardt commentedon Jan 2, 2020
@coderdipti - can you try with the latest pre-release version of ML.NET? https://www.nuget.org/packages/Microsoft.ML/1.5.0-preview. If that doesn't fix your issue, please open a new issue to track it with full repro steps - https://github.com/dotnet/machinelearning/issues/new
hamdidamar commentedon Apr 19, 2020
I think the problem will be solved in the next version, temporarily type
--" Install-Package Microsoft.ML -Version 1.5.0-preview "--
and run it in the package manager
cemilsavtekin commentedon Oct 2, 2020
Hi everyone
I get this error when publish to iis but it works in debug on vs.
I used CpuMathNative 1.5.2
@eerhardt
eerhardt commentedon Oct 2, 2020
@cemilsavtekin - this issue is quite old. Could you open an new issue with as much information as you can? Useful information would be:
.csproj