I have been using the Degirum PYSDK to create some applications using the precompiled YOLOv8n models in the Degirum model zoo.
Everything is working fine with those precompiled .hef files loading locally on my rpi5 running the latest Hailo8 4.20
I trained a custom yolov8 model which i compilied into its .hef that works with no issues using the example code from the
Hailo github
However When I try to run it into my application using the Degirum tools, the model loads without error, but when I try to inference an image it fails with the error
free(): invalid pointer
This is the code
import degirum as dg, degirum_tools
model = dg.load_model(
model_name=“custom1”,
inference_host_address=“@local”,
zoo_url = “models”
)
image_source=“TestImages/Bikes.jpg”
result = model(image_source)
Hi @pbrogers
We found out that 4.20 made some changes to output tensor format that broke compatibility with PySDK. Our next release of PySDK will fix this issue. In the meantime, can you please share your model json? We can suggest a workaround for now.
Here is the model json I was using. It was just a copy of yolov8n_relu6_coco–640x640_quant_hailort_hailo8_1 you had on your github page with the # of output class and model path adjusted to my model.
Hi @pbrogers
Our models have been compiled slightly differently to integrate with out postprocessors in a unified way (detection, segmentation and key points). If you followed hailo’s compilation guide, it already includes built-in NMS postprocessor. We published a guide on how to add your own model here: User Guide 3: Simplifying Object Detection on a Hailo Device Using DeGirum PySDK. We have support for it as well but in 4.20 some changes broke compatibility. So here are 4 approaches:
Compile the model again but this time without built-in NMS postprocessor. There is a line in .alls file that adds NMS and you can comment it out.
Modify JSON according to the guide above and use it with 4.19
Modify JSON according to the guide above and use it with next release of PySDK where we are going to fix the issue.
Change the OutputPostprocessType to None in the JSON and confirm that the mode runs. If so, we can help you with the postprocessor.
Hi @pbrogers
We released a new version of PySDK (0.15.1) that fixed the compatibility issue with Hailort 4.20. Please try and let us know if the problem still persists.