Hi @sahil,
The issue you’re encountering typically arises when the YOLOv8 model was compiled with Hailo’s built-in NMS enabled. When that happens, the model’s output format changes, and it won’t be compatible with DeGirum’s default DetectionYoloV8 postprocessor, which expects raw output.
Why this error happens:
The postprocessor is expecting an output tensor shaped like [N, 4 + num_classes], but the compiled model is returning [N, 1] instead, likely because NMS already compressed the detections. This shape mismatch causes the inference to fail.
What usually fixes it:
If Hailo NMS is indeed enabled, you’ll need to:
- Replace the default postprocessor with a custom Python-based postprocessor that can interpret the output format from the compiled model.
- Update the
.jsonconfig to reference that custom script.
We’ve helped users resolve similar issues by using a script like HailoDetectionYolo.py, which includes logic tailored to Hailo NMS output. You can find that thread here: Failure to deploy first custom model: DeGirum exceptions in postprocessing, tensor shape condition not met - #2 by khatami.mehrdad
To confirm the root cause and provide the exact solution, we’ll need to see your compiled .hef and its associated .json config file. These files will tell us whether NMS is applied and what postprocessing is appropriate.
If you can share those, our team will take a look and guide you from there.