yolov5_c3tr nms_config.json

I tried running the following command:
hailomz optimize --hw-arch hailo8 --har ./yolov5s_c3tr.har yolov5s_c3tr
and got the following error:

<Hailo Model Zoo INFO> Start run for network yolov5s_c3tr ...
<Hailo Model Zoo INFO> Initializing the hailo8 runner...
[warning] hw_arch from HAR is hailo8l but client runner was initialized with hailo8. Using hailo8
<Hailo Model Zoo INFO> Preparing calibration data...
[info] Loading model script commands to yolov5s_c3tr from /home/luo/Downloads/hailo_model_zoo-2.13/hailo_model_zoo/cfg/alls/generic/yolov5s_c3tr.alls
Traceback (most recent call last):
  File "/home/luo/anaconda3/envs/hailo/bin/hailomz", line 33, in <module>
    sys.exit(load_entry_point('hailo-model-zoo', 'console_scripts', 'hailomz')())
  File "/home/luo/Downloads/hailo_model_zoo-2.13/hailo_model_zoo/main.py", line 122, in main
    run(args)
  File "/home/luo/Downloads/hailo_model_zoo-2.13/hailo_model_zoo/main.py", line 111, in run
    return handlers[args.command](args)
  File "/home/luo/Downloads/hailo_model_zoo-2.13/hailo_model_zoo/main_driver.py", line 227, in optimize
    optimize_model(
  File "/home/luo/Downloads/hailo_model_zoo-2.13/hailo_model_zoo/core/main_utils.py", line 324, in optimize_model
    optimize_full_precision_model(runner, calib_feed_callback, logger, model_script, resize, input_conversion, classes)
  File "/home/luo/Downloads/hailo_model_zoo-2.13/hailo_model_zoo/core/main_utils.py", line 310, in optimize_full_precision_model
    runner.optimize_full_precision(calib_data=calib_feed_callback)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_common/states/states.py", line 16, in wrapped_func
    return func(self, *args, **kwargs)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py", line 1996, in optimize_full_precision
    self._optimize_full_precision(calib_data=calib_data, data_type=data_type)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py", line 1999, in _optimize_full_precision
    self._sdk_backend.optimize_full_precision(calib_data=calib_data, data_type=data_type)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/sdk_backend.py", line 1497, in optimize_full_precision
    model, params = self._apply_model_modification_commands(model, params, update_model_and_params)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/sdk_backend.py", line 1388, in _apply_model_modification_commands
    model, params = command.apply(model, params, hw_consts=self.hw_arch.consts)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/script_parser/nms_postprocess_command.py", line 385, in apply
    self._update_config_file(hailo_nn)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/script_parser/nms_postprocess_command.py", line 545, in _update_config_file
    self._layers_scope_addition(hailo_nn)
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/script_parser/nms_postprocess_command.py", line 588, in _layers_scope_addition
    bbox_decoder[field.value] = hailo_nn.get_layer_by_name(bbox_decoder[field.value]).name
  File "/home/luo/anaconda3/envs/hailo/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hailo_nn.py", line 529, in get_layer_by_name
    raise HailoNNException(f"The layer named {layer_name} doesn't exist in the HN")
hailo_sdk_common.hailo_nn.exceptions.HailoNNException: The layer named conv64 doesn't exist in the HN

I don’t understand what encoded_layer refers to, and how to determine which one it is in the onnx model I converted?

Hi @luozh122024,

Welcome to the Hailo Community!

You are probably seeing this error because the layers in your model are different from the ones in the model available in the ModelZoo.

To solve this, you can decompress the har file resulting from the parsing stage (tar -xvf HAR_PATH). There you should have an automatically generated nms config json. You can then pass its path here.