Search code examples
c++deep-learningcntk

CNTK C++ Eval for FastRCNN


I have a trained fastrcnn model on a custom set of images. I want to evaluate a new image using the model and the C++ Eval API. I flattened in the image into a 1D vector and acquired rois to input into the eval function.

    GetEvalF(&model);
// Load model with desired outputs
    std::string networkConfiguration;

//networkConfiguration += "outputNodeNames=\"h1.z:ol.z\"\n";
    networkConfiguration += "modelPath=\"" + modelFilePath + "\"";
    model->CreateNetwork(networkConfiguration);



// inputs are features of image: 1000:1000:3 & rois for image: 100
    std::unordered_map<string, vector<float>> inputs = { { "features", imgVector },{ "rois", roisVector } };

//outputs are roiLabels and prediction values for each one: 500
    std::unordered_map<string, vector<float>*> outputs = { { "roiLabels", &labelsVector }};

but when I try to evaluate with

model->Evaluate(inputs, outputs);

I have a 'no instance of overloaded function error'

Does somebody know how I'm wrong in my formatting?


Solution

  • Did you train your model using Python or BrainScript? If using Python, you should use CNTKLibrary API for evaluation, but not the EvalDll API (which works only for models trained with BrainScript). You can find more information about difference beween these two APIs in our Wiki page here. You can check this page about how to use CNTKLibrary API for model evaluation, and the example code. Instructions about how to build examples are described in this page.

    You can also use our Nuget packages to build your application.

    Thanks!