I am having some problem with my object detection project. I have a working solution that uses tensorflowsharp nuget. I am trying to get faster detection and I wanted to experiment with YOLO model.
I am using darkflow for having YOLO working with Tensorflow. I trained my model on my custom dataset and then I froze it using the instruction on the darkflow page. I now have my PB file and a metafile, so far so good.
I then adjusted my code in the tensorflowsharp project, pointing to the just created protobuf and adapted the name of the input output variables, from:
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());
}
to:
runner.AddInput("input:0", tensor).Fetch("output:0");
try
{
output = runner.Run();
}
catch (TFException e)
{
Console.WriteLine(e.ToString());
}
Following the name of the variables in the darkflow documentation. I am able to add input and output pointer to the session but when I get to run the detection (Runner.Run
) I get an exception:
TensorFlow.TFException: Expects arg[0] to be float but uint8 is provided
Runner.Run()
returns null.
I am not sure what the name of the output tensors are in darkflow, on the documentation I found:
The name of input tensor and output tensor are respectively 'input' and 'output'. For further usage of this protobuf file, please refer to the official documentation of Tensorflow on C++ API here.
but I would expect different collection (tensors) as return type as it is for SSD and other models, right?