SSD Object Detector Dual output

Hello,

I’ve been trying to run the tf2_ssdincepion_v2 model using dpu-pynq on an Ultra96-V2 using a modified version of the dpu_tf_inceptionv1.ipynb file.

By using the defaults of shapeOut = tuple(outputTensors[0].dims) I was able to get an output array of shape (1,1917,91) which I assume is the confidence score for each box.

If I access the second output tensor shapeOut2 = tuple(outputTensors[1].dims) it will give me a shape of (1,1917,4) which I assume will be the box locations.

However while trying to run with the second set of output tensors, the following error will be thrown:

 job_id = dpu.execute_async(input_data, output_data2)
double free or corruption (out)
Aborted (core dumped)

another method tried

shapeOut2 = tuple(outputTensors[1].dims)
outputSize2 = int(outputTensors[1].get_data_size() / shapeIn[0])
output_data2 = [np.empty(shapeOut2, dtype=np.float32, order="C")]

dpu_1 = vart.Runner.create_runner(subgraph[0], "run")
dpu_2 = vart.Runner.create_runner(subgraph[0], "run")
job_id = dpu_1.execute_async(input_data,output_data)
dpu_1.wait(job_id)
print("Job 1")
job_id2 = dpu_2.execute_async(input_data,output_data2)
dpu_2.wait(job_id2)
print("Job 2")

I am not sure how to proceed with doing the detection as from the graph generated using analyze_subgraphs.sh the subgraph has 2 outputs that require CPU processing to obtain the final result. As I am only able to obtain the first set of outputs, what should I do to get the second set of outputs without the program crashing?

Any help will be appreciated. Thank you!

Graph Image

1 Like

Hi there,

I’m not sure if this is the correct way of doing it, but if you can get 2 outputs out of your single runner instance, for inference you can try the following with a single dpu runner:

job_id = dpu.execute_async(inputs=image, outputs=output_data)
dpu.wait(job_id)

job_id = dpu.execute_async(inputs=image, outputs=output_data2)
dpu.wait(job_id)

This populates both output buffers and doesn’t crash my board at least.

Would be curious to know if you get this working. I would also consider asking this question on the broader Xilinx support forums as well.

Thanks
Shawn

1 Like

Hi Shawn,

Thanks for the help but as long as the output was set to (1,1917,4) the program still crashes. I will give the xilinx support forums a shot. Thanks!