Hailo BackendScriptParserException and CON70 errors while optimizing HAR

Hi everyone,

I’m trying to optimize a HAR model (net_4denoise_fixed.har) for Hailo8L using the Hailo AI Suite on my laptop. My goal is to run the model on a Hailo RPi5 board.

  1. Using model_script.alls

Command:
hailo optimize net_4denoise_fixed.har
–calib-set-path /local/workspace/calib_set
–model-script model_script.alls
–output-har-path net_4denoise_scope_fixed_optimized.har
–hw-arch hailo8l

Error:
hailo_sdk_client.sdk_backend.sdk_backend_exceptions.BackendScriptParserException: Parsing failed at:

!<set_layer_precisionnet_4denoise/resBlock7/conv3/Convuint8

Contents of model_script.alls:
set_layer_precision net_4denoise/resBlock7/conv3/Conv uint8

The parser throws a BackendScriptParserException at the first character, even though the format looks correct.

  1. Without model_script

If I run the same optimize command without --model-script, I get a CON70 error:
[CON70] Model contains unsupported layers or operations for the selected hardware (hailo8l).
This seems to indicate that some layers (like resBlock7/conv3) cannot be directly quantized or run on Hailo8L without specifying precision manually.

Environment:

Hailo AI Suite in Docker on Ubuntu laptop

CPU fallback (no GPU)

HailoRT version: 4.22.0

DFC version: 3.32.0

Target hardware: Hailo8L

Has anyone encountered these issues? Is there a specific formatting or spacing requirement for model_script.alls? Or any known workaround for the CON70 error?

Any help would be appreciated.

Thanks in advance!

Please have a look at the Hailo Dataflow Compiler User Guide section Optimization Related Model Script Commands.

I also recommend to run through the tutorials built into the Hailo AI Software Suite. Inside the Docker call:

hailo tutorial

Another good source to learn about the model scripts is the Hailo Model Zoo. There are example ALLS files for all models from the Model Zoo.

GitHub - Hailo Model Zoo - ALLS

Sure I took reference from the user guide and now I’m stuck here:
Model received quantization params from the hn
[info] MatmulDecompose skipped
[info] Starting Mixed Precision
[info] Model Optimization Algorithm Mixed Precision is done (completion time is 00:00:00.03)
[info] LayerNorm Decomposition skipped
[info] Starting Statistics Collector
[info] Using dataset with 64 entries for calibration
Calibration: 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 64/64 [00:04<00:00, 15.00entries/s]
[info] Model Optimization Algorithm Statistics Collector is done (completion time is 00:00:04.35)
[info] Starting Fix zp_comp Encoding
[info] Model Optimization Algorithm Fix zp_comp Encoding is done (completion time is 00:00:00.00)
[info] Matmul Equalization skipped
[info] Starting MatmulDecomposeFix
[info] Model Optimization Algorithm MatmulDecomposeFix is done (completion time is 00:00:00.00)
[info] No shifts available for layer sunnynet/conv4/conv_op, using max shift instead. delta=0.6587
:cross_mark: Optimization failed: Shift delta in sunnynet/avgpool1/avgpool_op is larger than 2 (5.86), cannot quantize. A possible solution is to use a pre-quantization model script command to reduce global average-pool spatial dimensions, please refer to the user guide for more info.

I added model alls as given on the user guide but I get this error:
Parsing failed at:

!<add_avgpool(name=‘pre_avgpool’,kernel=4,stride=4,input=‘sunnynet/conv4’,output=‘sunnynet/pre_avgpool’). Model script file not found in location:

Add a new average pooling layer to reduce spatial dimensions before global avgpool

add_avgpool(name=‘pre_avgpool’, kernel=4, stride=4, input=‘sunnynet/conv4’, output=‘sunnynet/pre_avgpool’)

Replace the input to the problematic global avgpool layer

replace_node(input=‘sunnynet/avgpool1’, new_input=‘sunnynet/pre_avgpool’)

Is there any lidar (without camera fusion) related examples?? for hailo??

Unfortunately, we do not have a lidar example in our repo. We do have partners that use lidar with the Hailo device.

Tier IV: Lidar and camera sensor fusion for high accuracy perception

https://hailo.ai/developer-zone/documentation/hailort/latest/?sp_referrer=api/python_api.html

I dont have access to this link.. I managed to compile the model into .hef file.. Currently struggling to run it on Rpi5 with hailo8 module.. I’m using hailort v4.23