Hello,

When I run my fine tuned yolov8 detection model on an Oakd SR, it outputs an error

Mask is not defined for output layer with width '3549'. Define at pipeline build time using 'setAnchorMasks' for 'side3549'

My understanding is that yolov8 is anchorless so I am not sure why it is outputting this error. When I try using the blob model provided by Luxonis (yolov8n_coco_640x352.blob), there isn't any issues.

I tried setting anchors for the DetectionNetwork but it is still an issue. Note that I am using BlobConverter to convert my fine tuned yolov8n model. I tried using tools.luxonis but it keeps outputing an error 500.

Can anyone provide an insight into my it is outputting that error even though you are not suppose to specify anchors for yolov8?

    izou3
    You should convert it through tools.luxonis. If it doesn't work, there is something wrong with the model. Can you send over the .pt file so we can take a look?

    Thanks,
    Jaka

      izou3 Yes, I also stumbled on this issue a while back: anchor-less YOLO models converted by blobconverter don't work with YoloDetectionNetwork, but they do if you use Luxonis' online model conversion tool.

      As explained here, the online converter "uses a slightly edited Detection head, which removes some of the final processing operations from the original head. That is because these steps are done inside the YoloDetectionNetwork node from DepthAI library, so that is why it didn't work.".

        jakaskerl

        Yes usually before I use tools.luxonis but it wasn't working yesterday as it seems the server is down. I tried it today and everything works fine. Note that I also was able to solve this by using luxonis tools to convert it to onnx and passing that onnx version to the blob converter.

        Thanks for your help!

        xperroni

        Got it. I used this tool here to convert it to onnx and passed that through the blob which seemed to work too.

        Thanks for your help!