How to use on c/c++
i want to use model and action commands on c/c++
is there any samples?
Hi seokhoonboo,
Please take a look at the CNTKCore\EvalDLL, Extensibility\EvalWrapper, and Extensibility\CSEvalClient. The EvalDll provides some functionality for evaluating models. The EvalWrapper is consumer/wrapper of the EvalDLL (which shows how to use the EvalDLL). The CSEvalClient is a C# client using the EvalWrapper.
We don't have a full API yet for all actions.
Thanks,
Gaizka
eh... i already saw that. so i tried like below
#include <Windows.h>
#include "ExceptionWithCallStack.h"
#include "Eval.h"
#include <Basics.h>
#pragma comment(lib,"EvalDll.lib")
using namespace Microsoft::MSR::CNTK;
int _tmain(int argc, _TCHAR* argv[])
{
Eval
return 0;
}
but it occurs "unresolved external symbol error LoadModel,Eval,~Eval" Do I need to override the functions?
other way, i tried below
#define CPUONLY
#include <EvalDll/CNTKEval.cpp>
#include <ExceptionWithCallStack.cpp>
using namespace Microsoft::MSR::CNTK;
int _tmain(int argc, _TCHAR* argv[]) {
CNTKEval<float> model;
model.Init("C:/Users/dspl/Downloads/CNTK-master/Examples/Image/MNIST/Config/01_OneHidden.cntk"); model.LoadModel(L"Models/01_OneHidden");
return 0;
} It works;;; So I use?
The second method should work fine. As you can infer from the interface IEvaluateModel, you are limited to those functions. in your example:
std::map<std::wstring, std::vector
will evaluate inputs against the model and provide the results in the outputs
Best regards,
Sorry, formatting went wrong...
std::map<std::wstring, std::vector<ElemType>*> inputs;
std::map<std::wstring, std::vector<ElemType>*> outputs;
{allocate inputs and outputs structures}
model.Evaluate(inputs, outputs)
Extract values from outputs
Simple sample for c++ model loading https://github.com/dmandreev/simplestcntkapp