Runner.translate_tf_model » node name StatefulPartitionedCall:0 in end_node_names is missing?

Hi everybody, I just compiled our first model in TensorFlow lite aka TFlite format and got the following error message:
InvalidHNError: The original node name StatefulPartitionedCall:0 in end_node_names is missing in the HN.
What can I do? Thanks for your help.
Klaus


InvalidHNError Traceback (most recent call last)
Cell In[18], line 7
4 model_path = “…/models/GN_MobileNetV2-2024-10-15.tflite”
6 runner = ClientRunner(hw_arch=chosen_hw_arch)
----> 7 hn, npz = runner.translate_tf_model(model_path, model_name)

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_sdk_common/states/states.py:16, in allowed_states..wrap..wrapped_func(self, *args, **kwargs)
12 if self._state not in states:
13 raise InvalidStateException(
14 f"The execution of {func.name} is not available under the state: {self._state.value}",
15 )
—> 16 return func(self, *args, **kwargs)

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_sdk_client/runner/client_runner.py:1222, in ClientRunner.translate_tf_model(self, model_path, net_name, start_node_names, end_node_names, tensor_shapes)
1182 “”"
1183 DFC API for parsing a TF model given by a checkpoint/pb/savedmodel/tflite file. This creates
1184 a runner with loaded HN (model) and parameters.
(…)
1219
1220 “”"
1221 parser = Parser()
→ 1222 parser.translate_tf_model(
1223 model_path=model_path,
1224 net_name=net_name,
1225 start_node_names=start_node_names,
1226 end_node_names=end_node_names,
1227 tensor_shapes=tensor_shapes,
1228 )
1229 return self._finalize_parsing(parser.return_data)

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_model_optimization/tools/subprocess_wrapper.py:124, in subprocess_wrapper..decorator..parent_wrapper(self, *args, **kwargs)
122 self.dist_info = dist_info
123 self.build_model()
→ 124 func(self, *args, **kwargs)
126 # This flag should be present in Develop
127 if force_rebuild:

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py:101, in Parser.translate_tf_model(self, model_path, net_name, start_node_names, end_node_names, tensor_shapes)
98 suggest_other_node_names(name, node_names, “End”)
100 self._return_data[“original_model_meta”][“original_model_path”] = os.path.abspath(model_path)
→ 101 parsing_results = self.parse_model_to_hn(
102 graph,
103 values,
104 valid_net_name,
105 start_node_names,
106 end_node_names,
107 nn_framework,
108 )
109 milestone = self._format_time_milestone(start_time)
110 self._logger.info(
111 f"Translation completed on Tensorflow model {valid_net_name} (completion time: {milestone})",
112 )

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_sdk_client/sdk_backend/parser/parser.py:368, in Parser.parse_model_to_hn(self, model, values, net_name, start_node_names, end_node_names, nn_framework, output_shapes, net_input_format, rename_layers_by_blocks)
365 raise BackendRuntimeException(f"Unsupported NN framework {nn_framework}“)
367 fuser = HailoNNFuser(converter.convert_model(), net_name, converter.end_node_names)
→ 368 hailo_nn = fuser.convert_model()
369 hailo_nn.validate_stage(HnStage.HN)
371 input_layers = [f”‘{x.original_names[0]}’: ‘{x.name}’" for x in hailo_nn.get_input_layers()]

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py:108, in HailoNNFuser.convert_model(self)
105 self._run_post_folding_optimizations()
107 # phase 4: put final touches on the fused model (scope, indices, names)
→ 108 self._finalize_fused_model()
110 return self._output_graph

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_sdk_client/model_translator/fuser/fuser.py:467, in HailoNNFuser._finalize_fused_model(self)
465 self._output_graph.update_output_indices()
466 self._output_graph.add_scopes()
→ 467 self._output_graph.update_output_layers_order(self._end_node_names)
468 self._output_graph.calculate_shapes()
469 self._output_graph.validate_shapes()

File ~/.pyenv/versions/3.10.15/lib/python3.10/site-packages/hailo_sdk_common/hailo_nn/hailo_nn.py:909, in HailoNN.update_output_layers_order(self, original_end_nodes_order)
907 for node_name in valid_original_end_nodes:
908 if node_name not in handled_nodes:
→ 909 raise InvalidHNError(
910 f"The original node name {node_name} in end_node_names is missing in the HN.",
911 )
913 self.net_params.output_layers_order = out_layers_order
914 else:

InvalidHNError: The original node name StatefulPartitionedCall:0 in end_node_names is missing in the HN.

Hey @Klaus

When you encounter this error:

InvalidHNError: The original node name StatefulPartitionedCall:0 in end_node_names is missing in the HN

It means your TensorFlow Lite model’s node names don’t align with what the Hailo SDK expects.

How to Fix It:

  1. Validate Node Names

    • Double-check that StatefulPartitionedCall:0 matches your TFLite model’s output node names
    • Node names can change during model export, so verify the exact names in your model’s graph
  2. Ensure SDK Compatibility

    • Verify your model uses only Hailo-supported layers and nodes
  3. Configure Model Translation

    • Explicitly specify both start_node_names and end_node_names in your configuration

Would you like me to elaborate on any of these steps?

Hi omria, we are using TF Quantization Aware Training and just learned that TF QAT is not supported by Hailo. I am afraid we need to retrain using TF or Hailo Docker. What is your recommendation? Thanks for your help, Klaus

Hi Klaus,

I’d recommend the Hailo Docker approach since it’s specifically designed for Hailo hardware and will give you better results with less optimization work later.