FastRCNN 的 CNTK C++ 评估
CNTK C++ Eval for FastRCNN
我在一组自定义图像上训练有一个 fastrcnn 模型。我想使用模型和 C++ Eval API 评估新图像。我将图像展平为一维向量并获取 rois 以输入到 eval 函数中。
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 }};
但是当我尝试用
进行评估时
model->Evaluate(inputs, outputs);
我有一个'no instance of overloaded function error'
有人知道我的格式有什么问题吗?
您是否使用 Python 或 BrainScript 训练您的模型?如果使用 Python,您应该使用 CNTKLibrary API 进行评估,而不是 EvalDll API(它仅适用于使用 BrainScript 训练的模型)。您可以在我们的 Wiki 页面 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 中找到有关这两个 API 之间差异的更多信息。
您还可以使用我们的 Nuget packages 来构建您的应用程序。
谢谢!
我在一组自定义图像上训练有一个 fastrcnn 模型。我想使用模型和 C++ Eval API 评估新图像。我将图像展平为一维向量并获取 rois 以输入到 eval 函数中。
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 }};
但是当我尝试用
进行评估时model->Evaluate(inputs, outputs);
我有一个'no instance of overloaded function error'
有人知道我的格式有什么问题吗?
您是否使用 Python 或 BrainScript 训练您的模型?如果使用 Python,您应该使用 CNTKLibrary API 进行评估,而不是 EvalDll API(它仅适用于使用 BrainScript 训练的模型)。您可以在我们的 Wiki 页面 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 中找到有关这两个 API 之间差异的更多信息。
您还可以使用我们的 Nuget packages 来构建您的应用程序。
谢谢!