Compailing rectangle model

Hi Hailo Community,

I’m trying to convert a YOLOv8m model that is rectangular (with imgsz=640 and rect=True), but I’m encountering issues during the HAR-to-HEF optimization process.

Issue Details:

During optimization, the conv82 layer shows near-zero weights, and the optimizer replaces it with a node named yolov8m/conv82_const_replacement. Later, when the compiler adds output layers, the process fails with the following error:

[info] Loading network parameters
[info] Starting Hailo allocation and compilation flow
[info] Adding an output layer after conv57
[info] Adding an output layer after conv58
[info] Adding an output layer after conv70
[info] Adding an output layer after conv71
[info] Adding an output layer after conv82_const_replacement
[info] Adding an output layer after conv83
[info] Finding the best partition to contexts…
[…<==>…] Duration: 00:01:14
Iteration Done
[…<==>…] Duration: 00:00:14
Iteration Done, Performance improved by 8.9%
[…<==>…] Duration: 00:00:14
Iteration Done, Performance improved by 13.3%
[…<==>…] Duration: 00:00:18
Iteration Done, Performance improved by 0.2%
[…<==>…] Duration: 00:00:16
Iteration Done, Performance improved by 8.4%
[…<==>…] Duration: 00:00:14
Iteration Done, Performance improved by 3.8%
[…<==>…] Duration: 00:00:13
Iteration Done, Performance improved by 4.2%
[…<==>…] Duration: 00:00:22
Iteration Done, Performance improved by 4.2%
compiler: …/src/allocator/slotter.cpp:481: std::vector<hw_graph::context_t> allocator::move_contexts(const hw_graph::context_t&, allocator::NodesByContextMap&, const std::vector<network_graph::NetworkNode*>&, std::shared_ptr<utils::GraphInterface<network_graph::NetworkNode, network_graph::NetworkEdge> >): Assertion `pos != nodes_in_context_to_change.end()’ failed.
[error] Failed to produce compiled graph
[error] BackendAllocatorException: Compilation failed with unexpected crash

I have also tried different .pt to .onnx export options, but nothing works.

Context:

The model was originally designed for (640,640) input, and I'm converting it to a rectangular format.
The near-zero activation in conv82 is causing it to be replaced by conv82_const_replacement.

Any guidance or suggestions on how to address this conv82 issue would be greatly appreciated.

Beforehand Thanks

Hi @samvel.arakelyan03,

Welcome to the Hailo Community!

Have you tried compiling with the compiler optimization flow disabled?