Model optimize process

Hello,

After the optimization process, the model structure changed.

Looking at it, an error occurred when another layer was newly created on one of the last conv nodes.

After analyzing it, it seems that the reason is that model_script provided the model_optimization_config option.

why is the model layer structure changing?

Hey @SY_E,

This is expected behavior based on your model_optimization_config settings.

What’s happening: The Hailo compiler intentionally modifies model graphs during optimization to ensure hardware compatibility and performance. Common modifications include:

  • Layer fusion/splitting for efficient execution
  • Pre/post-processing layer insertion (controlled by flags like insert_pre_post_layers)
  • Layout transformations (NHWC/NCHW alignment)
  • Hardware-specific operation replacements

Root cause: Your model_script with the supplied model_optimization_config is triggering these structural changes. Key config flags that affect model structure:

  • replace_softmax_with_argmax
  • remove_dropout
  • fuse_bn
  • output_nodes
  • layer_placement

Hope this helps!