Clarification re deployment of EvalWrapper.dll on different target machine
I've developed a C# application that uses the EvalWrapper.dll to successfully evaluate a trained model when deployed on the machine where the model was built with CNTK fully installed. But how do I port the model, EvalWrapper.dll, and EvalDll.dll over to another target machine and configure to run? I've tried copying these files to the target machine, referencing the EvalWrapper.dll in the application and placing the EvalDll.dll in the Path system variables, but am receiving the following exception:
Microsoft.MSR.CNTK.Extensibility.Managed.CNTKException occurred
HResult=-2146233088
Message=Cannot find library: evaldll.dll
Source=EvalWrapper
Also tried to place the EvalDll.dll in the Windows\System32 and Windows\Syswow64 to no avail.
I was hoping a full install of CNTK would not be necessary on the target machine, but perhaps there are certain dependencies to evaluate a model. Thoughts?
You need to place EvalDll.dll in the same folder as EvalWrapper.dll - but also a couple of other DLLs, like Math.dll. There's a feature request #267 already to package all those up into a nuget package. I'm working with @wolfma61 and @gaizkan to test that package, I hope we'll be there soon.
If you want to evaluate a CNTK model on a CPU-only machine, you need the following libraries (obviously from a CPUOnly build of CNTK) to live alongside your executable:
EvalDll.dllEvalWrapper.dlllibacml_mp_dll.dlllibifcoremd.dlllibifportmd.dlllibiomp5md.dlllibmmd.dllMath.dllsvml_dispmd.dll
Thank you @ant0nsc, that worked! After building the Release_CpuOnly version and retraining the network with deviceId=-1, I copied over the dlls (non-reader) from my C:\Repos\cntk\x64\Release_CpuOnly folder on the source machine to the execution folder on the target machine and only needed to reference the EvalWrapper.dll.
I see the Release (cpu/gpu) version adds the following Gpu related dlls (non-reader):
- cublas64_75.dll
- cudart64_75.dll
- cudnn64_75.dll
- curand64_75.dll
- cusparse64_75.dll
- nvml.dll
It begs the question, how can a network model built with the Release version using a GPU device ID to reduce model training time be distributed since the target machine may or may not have a compatible CUDA enabled Gpu? For example, can a model built with a Gpu release be evaluated on a server without a GPU?
I am also using what appears to be an override for the deviceId when the model is evaluated but unclear if this will enable a Gpu model to work on a Cpu-only machine.
model.CreateNetwork(string.Format("deviceId=-1\nmodelPath=\"{0}\"", modelFilePath));
Your efforts to clarify and package a solution for distributed model evaluation are much appreciated.
Yes, you can take a model trained on a GPU box, and evaluate it on a CPU box - I did the very same thing successfully today.
Excellent, thank you for confirming.