CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Cannot load assembly Cntk.Core.CSBinding-2.3.1.dll'

Open ddobric opened this issue 8 years ago • 15 comments

Have created a new Csharp project and added a reference to CNTK nugget package. Wenn running application CSBinding assembly cannot be loaded:

"Unable to load DLL 'Cntk.Core.CSBinding-2.3.1.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

Thanks Damir

ddobric avatar Jan 30 '18 11:01 ddobric

Try changing platform from Any CPU to x64.

KichangKim avatar Jan 30 '18 12:01 KichangKim

Project is already on x64. Unfortunately it does not help? Repro Steps:

  1. Create .NET project
  2. Change build to x64
  3. Add nugget ref to CNTK.CPUOnly
  4. Run

Result: Application fails with named exception.

After build only Cntk.Core.Managed-2.3.dll is referenced. All other assemblies like: Cntk.Core.* Cntk.Math.* Cntk.PerformancePrifiler* Cntk.Deserializers* Cntk.Composite* ...

are not copied to bin folder. After I copy them manually from official example build all works fine.

ddobric avatar Feb 13 '18 11:02 ddobric

Where did you get the copy of all the Cntk dll's?

rposener avatar Mar 10 '18 16:03 rposener

Have the same issue with version 2.5. Only Cntk.Core.Managed-2.5 in References.

PavelAgurov avatar Mar 17 '18 21:03 PavelAgurov

Manually copied from \packages\CNTK.CPUOnly.2.4.0\support\x64\Release\ files:

Cntk.Composite-2.4.dll Cntk.Core-2.4.dll Cntk.Core.CSBinding-2.4.dll Cntk.Deserializers.Binary-2.4.dll Cntk.Deserializers.HTK-2.4.dll Cntk.Deserializers.Image-2.4.dll Cntk.Deserializers.TextFormat-2.4.dll Cntk.Math-2.4.dll Cntk.PerformanceProfiler-2.4.dll

Works now.

Project should be x64.

PavelAgurov avatar Mar 17 '18 21:03 PavelAgurov

Also need to copy: libiomp5md.dll mkldnn.dll mklml.dll (140 MB!!!!)

Application can't work without it. Just crashed without clear messages.

PavelAgurov avatar Mar 18 '18 16:03 PavelAgurov

The issue here is setting of build to x64. Usually x64 in .NET project is set on project level. When using CNTK x64 has to be set on the solution level. This will fix the problem. It means no more copying of files required.

My recommendation to team would be to use x64 on the project level as typically expected by .NET developers.

ddobric avatar Mar 20 '18 08:03 ddobric

I did it. My project is x64, I've remove and install nuget package, but no - I have only one link in refs. All other DLLs are out of scope and I should add it manually. Will try to set x64 for solution. Possible it's way.

PavelAgurov avatar Mar 20 '18 10:03 PavelAgurov

I'm encountering this problem in .NET core 2.1 with 2.6.0-rc0.dev20180821

I've tried added x64 to the propertyGroup of my csproj file but with no success.

Where should it be set to resolve this issue?

Rleahy avatar Sep 07 '18 16:09 Rleahy

have the same problem with 2.6.0, but not when running the app from VS, but when running from folder publish output. dll copy works. looks like publish profile doesn't pick up the links

dotnicht avatar Sep 16 '18 18:09 dotnicht

I can only surmise there is a build error on the 'Cntk.Core.Managed-2.6' dll.

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "Cntk.Core.Managed-2.6, Version=2.6.0.0, Culture=neutral, PublicKeyToken=a82c1f3f67b62253, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

The dll is in the following directory's:

packages\CNTK.GPU.2.6.0\lib\netstandard2.0

packages\CNTK.CPUOnly.2.6.0\lib\netstandard2.0

My project is x64 in all possible areas. I still get the issue. Perhaps making the project .NetStandard may fix the issue?

GuntaButya avatar Feb 08 '19 20:02 GuntaButya

Try to set x64 not for project but for all solution. Only this way works for me.

PavelAgurov avatar Feb 09 '19 09:02 PavelAgurov

@PavelAgurov - Youre right, I also found this yesterday after struggling with the message presented. Thanks.

So steps are: Right click your solution, click Configuration Manager:

step one

Change your Platform to 64

step two

Click ok, and this should fix the problem.

Have fun!

GuntaButya avatar Feb 09 '19 22:02 GuntaButya

Any idea how to do this in i'm using VS Code im not using VS, could you post the csproj file that making that change generates?

Rleahy avatar Apr 12 '19 09:04 Rleahy

In Code? I would say that's not possible as this is a Pre-Code Level configuration for your project.

GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Release|Any CPU = Release|Any CPU Release|x64 = Release|x64 EndGlobalSection

GuntaButya avatar Apr 12 '19 20:04 GuntaButya