code: def build(self):
      layers = self.model.layers or self.model.layer
      layers = self.filter_layers(layers)
      nodes = self.make_input_node()
      nodes += [self.make_node(layer) for layer in layers]
      graph = CaffeGraph(nodes=nodes, name=self.model.name)
      node_outputs = {}
      for idx, layer in enumerate(layers):
          node = graph.get_node(layer.name)
          for input_name in layer.bottom:
              assert input_name != layer.name
              parent_node = node_outputs.get(input_name)
              if (parent_node is None) or (parent_node == node):
                  parent_node = graph.get_node(input_name)
              if parent_node.layer:
                  for i, output in enumerate(parent_node.layer.top):
                      if input_name == output:
                          node.add_parent(parent_node, i)
              else:
                  node.add_parent(parent_node, 0)
          for output_name in layer.top:
              if output_name == layer.name:
                  continue
              node_outputs[output_name] = node
      graph.compute_output_shapes(self.model)
      return graph
  
imports: from collections import namedtuple
  from functools import reduce
  from google.protobuf import text_format
  from copy import deepcopy
  import numbers
  import os
  import tempfile
  from mmdnn.conversion.caffe.mapper import get_handler_name
  from mmdnn.conversion.caffe.resolver import get_caffe_resolver, has_pycaffe
  from mmdnn.conversion.caffe.shape import *
  from mmdnn.conversion.caffe.errors import print_stderr, ConversionError
label_desc: Use image node_id 7 for calling the GraphBuilder obj's underlying member method code with example usage: obj.build() and returns: graph