| 172 | return self._model, self._quantize_activation_info |
| 173 | |
| 174 | def initialize_name_map(self): |
| 175 | for input_node in self._option.input_nodes.values(): |
| 176 | # When tf.Keras > 2.2 version, input_node, it is possible |
| 177 | # that input_node.name and model input tensor name are different. |
| 178 | if self._option.platform == Platform.KERAS: |
| 179 | input_name_parts = input_node.name.split(":") |
| 180 | if len(input_name_parts) == 2: |
| 181 | input_name_without_postfix = input_name_parts[0] |
| 182 | for op in self._model.op: |
| 183 | for i, name in enumerate(op.input): |
| 184 | if name == input_name_without_postfix: |
| 185 | op.input[i] = input_node.name |
| 186 | |
| 187 | new_input_name = (MaceKeyword.mace_input_node_name |
| 188 | + '_' + input_node.name) |
| 189 | self.input_name_map[input_node.name] = new_input_name |
| 190 | if input_node.data_format == DataFormat.NONE: |
| 191 | self._has_none_df = True |
| 192 | |
| 193 | output_nodes = self._option.check_nodes.values() |
| 194 | for output_node in output_nodes: |
| 195 | new_output_name = MaceKeyword.mace_output_node_name \ |
| 196 | + '_' + output_node.name |
| 197 | self.output_name_map[output_node.name] = new_output_name |
| 198 | |
| 199 | def filter_format(self): |
| 200 | filter_format_value = ConverterUtil.get_arg(self._model, |