Dfine transformer converting onnx -> har -> hef

It shows an error saying that the input shape is not supported. In this case, how should I proceed?

— Loading from Hailo Archive: dfine_l_coco.har —
— Loading 8 images for calibration —

— Starting Quantization… —
[info] For NMS architecture yolov5 the default engine is auto. For other engine please use the ‘engine’ flag in the nms_postprocess model script command. If the NMS has been added during parsing, please parse the model again without confirming the addition of the NMS, and add the command manually with the desired engine.
[info] Using the default score threshold of 0.3 (range is [0-1], where 1 performs maximum suppression) and IoU threshold of 1.0 (range is [0-1], where 0 performs maximum suppression).
Changing the values is possible using the nms_postprocess model script command.
[info] The activation function of layer dfine_l_coco/conv21 was replaced by a Sigmoid
[info] The activation function of layer dfine_l_coco/conv45 was replaced by a Sigmoid
[info] The activation function of layer dfine_l_coco/conv53 was replaced by a Sigmoid

An unexpected error occurred: Unexpected input_shapes at feature multiplier layer dfine_l_coco/feature_multiplier21, input_shapes=[[-1, 80, 80, 512], [-1, 80, 80, 512]] (type=<class ‘list’>)

Hey @GGURIg,

The “Unexpected input_shapes at feature multiplier” error is coming from the Dataflow Compiler’s quantizer choking on the fused element-wise multiplication (the “FeatureMultiplier” layer) in your network. Even though in general we support two inputs of the same shape (e.g. [N,H,W,F] * [N,H,W,F]) , there are still a few cases—particularly fused or bit-packed multiplies—where you need to break that layer apart so the compiler can handle it.

The quickest way to unblock yourself is to turn on the built-in pre-quantization optimization that splits those multiplies into simpler pieces. In your model-script (or via the CLI --pre_quantization_optimization flag), add:

# Split the element-wise multiply by bit significance
pre_quantization_optimization(split_ew_mult_by_bit_significance)
# Also split any fused activations - this helped in my case too
pre_quantization_optimization(split_fused_activation)

Once you add those, re-run your quantization on dfine_l_coco.har and it should work. The compiler will automatically insert some intermediate layers to break down each multiply into simpler operations it can actually handle.

Let me know if you’re still hitting issues after that!