          for name, inbound in struct.items():
              if name not in required_layers:
                  logger.debug("Skipping unused layer: '%s'", name)
                  continue
              layer = layer_dict[name]
              logger.debug("Processing layer '%s': (layer: %s, inbound_nodes: %s)",
                           name, layer, inbound)
              if not inbound:
                  logger.debug("Adding model inputs %s: %s", self._input_names, self._inputs)
                  model = layer(self._inputs)
 
</s> remove                          name, layer, inbound)
 </s> add                          layer.name, layer, inbound) </s> remove         for name, inbound in struct.items():
            if name not in required_layers:
                logger.debug("Skipping unused layer: '%s'", name)
 </s> add         for layer in saved_model.layers:
            if layer.name not in struct:
                logger.debug("Skipping unused layer: '%s'", layer.name) </s> remove                 logger.debug("Adding model inputs %s: %s", self._input_names, self._inputs)
                model = layer(self._inputs)
 </s> add                 model = model_inputs
                logger.debug("Adding model inputs %s: %s", layer.name, model) </s> remove         required_layers = self._get_required_layers(struct)
        logger.debug("Compiling model")
        layer_dict = {layer.name: layer for layer in saved_model.layers}
 </s> add         model_inputs = self._get_inputs(saved_model.inputs) </s> remove                 layer_inputs = [compiled_layers[inp] for inp in inbound]
                logger.debug("Compiling layer '%s': layer inputs: %s", name, layer_inputs)
 </s> add                 layer_inputs = []
                for inp in inbound:
                    inbound_layer = compiled_layers[inp[0]]
                    if isinstance(inbound_layer, list) and len(inbound_layer) > 1:
                        # Multi output inputs
                        inbound_output_idx = inp[1]
                        logger.debug("Selecting output index %s from multi output inbound "
                                     "layer: %s", inbound_output_idx, inbound_layer)
                        layer_inputs.append(inbound_layer[inbound_output_idx])
                    else:
                        layer_inputs.append(inbound_layer)

                logger.debug("Compiling layer '%s': layer inputs: %s", layer.name, layer_inputs)
            inbound = struct[layer.name]
          for name, inbound in struct.items():
              if name not in required_layers:
                  logger.debug("Skipping unused layer: '%s'", name)
                  continue
            inbound = struct[layer.name]
              logger.debug("Processing layer '%s': (layer: %s, inbound_nodes: %s)",
                           name, layer, inbound)
              if not inbound:
                  logger.debug("Adding model inputs %s: %s", self._input_names, self._inputs)
                  model = layer(self._inputs)
keep keep keep keep replace keep keep keep keep keep
 plugins.train.model.base - More robust inference model generation 
plugins/train/model/_base.py