Darkflow frozen pb - tensorflowsharp输出

时间:2018-01-22 16:00:54

标签: c# c++ tensorflow darknet darkflow

我的对象检测项目有问题。我有一个使用tensorflowsharp nuget的工作解决方案。我想要更快的检测,我想尝试YOLO模型。

我正在使用darkflow让YOLO使用Tensorflow。我在我的自定义数据集上训练了我的模型,然后使用darkflow页面上的指令将其冻结。我现在有我的PB文件和图元文件,到目前为止一直很好。

然后我调整了tensorflowsharp项目中的代码,指向刚刚创建的protobuf并调整了输入输出变量的名称,来自:

String[] outputs = { "detection_boxes:0", "detection_scores:0", "detection_classes:0", "num_detections:0" };
runner.AddInput("image_tensor:0", tensor).Fetch(outputs);
try
{
   output = runner.Run();
}
catch (TFException e)
{
   Console.WriteLine(e.ToString());
}

为:

runner.AddInput("input:0", tensor).Fetch("output:0");
try
{
    output = runner.Run();
}
catch (TFException e)
{
    Console.WriteLine(e.ToString());
}

在darkflow文档中跟随变量的名称。我能够向会话添加输入和输出指针,但是当我开始运行检测(Runner.Run)时,我得到一个异常:

TensorFlow.TFException: Expects arg[0] to be float but uint8 is provided

Runner.Run()返回null。

我不知道输出张量的名称在暗流中是什么,在我发现的文档中:

  

输入张量和输出张量的名称分别是“输入”和“输出”。有关此protobuf文件的进一步使用,请参阅此处有关C ++ API的Tensorflow官方文档。

但我希望不同的集合(张量)作为返回类型,就像SSD和其他型号一样,对吗?

0 个答案:

没有答案
相关问题