As shown in the figure, in the ONNX structure, the tensor is converted to [1, 64, 16, 16] after reshape.
However, in the .har format, the tensor is incorrectly converted to [16, 16, 256].
Is there any way to fix this?
.har graph has incorrect channel information.
The code used for the conversion is as follows:
from hailo_sdk_client import ClientRunner
onnx_path = "./nanotrack/nanotrack_sim.onnx"
onnx_model_name = "nanotrack_sim"
chosen_hw_arch = "hailo8l"
runner = ClientRunner(hw_arch=chosen_hw_arch)
end_node_names = [
'/ban_head/cls_logits/cls_logits.0/Conv',
'/ban_head/bbox_pred/bbox_pred.0/Conv',
]
net_input_shapes = {"xf": [1, 1, 255, 255], "zf": [1, 1, 127, 127]}
try:
hn, npz = runner.translate_onnx_model(
onnx_path,
onnx_model_name,
end_node_names=end_node_names,
net_input_shapes=net_input_shapes, # Adjust input shapes if needed
)
print("Model translation successful.")
except Exception as e:
print(f"Error during model translation: {e}")
raise
hailo_model_har_name = f"./nanotrack/{onnx_model_name}_hailo_model.har"
try:
runner.save_har(hailo_model_har_name)
print(f"HAR file saved as: {hailo_model_har_name}")
except Exception as e:
print(f"Error saving HAR file: {e}")