-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Unable to load DLL 'CpuMathNative' #4870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For some reasons you have to copy the DLL to the directory with the exe in it. You can find it in projectname/packages/Microsoft.ML.CpuMath/runtimes/win-x64/nativeassets/netstandard2.0 |
Worked Bro... Thanks a ton.. |
I've been all over the Internet trying to resolve this issue. What a wacky solution! But it works. |
@ArnieBerg have you tried one of the workarounds I listed here or here? We shipped a bug in version Another easy way to fix this is to use Use |
Yes, I was aware of those other posts and took those steps as well as the use of PackageReference, all to no avail. I am on 1.4.0 of the Microsoft.ML libs. |
What version of visual studio are you using? Did you set your Platform to x86 or x64? Can you share your project and I can take a look to see if there is anything fix that needs to be made here? I’d recommend using 1.5.0-preview2 version. It has all the functionality of 1.4.0, plus some preview features not in 1.4.0. So anything you are trying to use in 1.4.0 will work exactly the same in 1.5.0-preview2. |
My project is set to x64. I was on 1.5.0-preview2 initially but walked that back after running into this grief. I will move back to the preview2. Project attached. |
Thanks, @ArnieBerg. However, the project you attached is a class library. It isn't an application: Can you share the project that produces an .exe that consumes this class library as well? That is the project that needs to be set to |
This is the calling app. It is targeting 64 bit platform. |
@ArnieBerg - I noticed that you don't have <PackageReference Include="Microsoft.ML">
<Version>1.4.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ML.CpuMath">
<Version>1.4.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.ML.LightGbm">
<Version>1.4.0</Version>
</PackageReference> In your Also - be sure you are setting |
I want to use ml.net embedded class library as a plugin in another application. I followed all the fix above but it seems not work although it works with normal windows application. The exceptions are Unable to load DLL 'tensorflow' or one of its dependencies: The specified module could not be found. (Exception from HRESULT: 0x8007007E) and the same for 'CpuMathNative.' How can I solve this problem? Thank you in advanced |
@pthinh14 - for the |
@eerhardt that application keeps saying Unable to load DLL 'tensorflow' or one of its dependencies although I did reference SciSharp.TensorFlow.Redist. I'm not sure if explicitly add tensorflow.dll to my managed code is a good idea. Hope to see your view on that. |
Did you reference |
@eerhardt I assume I did
|
Did you also tell your application to target It might be easiest if you zip your repro app and post it. Or if you create a git repo with an application showing the issue. |
Yes, I did. I tried many proposed solutions but they seem not working in this case. |
@pthinh14 ML.NET hasn't been tested with Scisharp.TensorFlow.Redist version 2.1.0. We are currently on version 1.14.0. Can you try that version? |
@harishsk I tried but it did not work. |
@pthinh14 - The project you linked above is not an application - it is a Class Library. When I said "application" above, I specifically meant the project that outputs an |
@eerhardt Do projects that reference projects that reference the ml.net nuget packages have to reference the nuget packages themselves? We have a asp.net site that references a project that uses the ml.net packages. Both of our projects are set to x64. Periodically it stops working with the Unable to load DLL 'CpuMathNative' error. |
From what I've noticed it depends on what kind of .csproj you are using with all of them. If you are using the traditional If you are using the traditional If you are using |
System information
Issue
Unable to load DLL 'CpuMathNative'
What did you do?:
Created a new .net standard project, added ML.NET from nuget and added the project to my existing solution (.net Framework 4.7.2). Set to Any x64.
The text was updated successfully, but these errors were encountered: