def load(self):
        """Load TensorFlow model into MIL program."""

        logger.info("Loading TensorFlow model '{}'".format(self.model))
        outputs = self.kwargs.get("outputs", None)
        output_names = get_output_names(outputs)
        self._graph_def = self._graph_def_from_model(output_names)

        if self._graph_def is not None and len(self._graph_def.node) == 0:
            msg = "tf.Graph should have at least 1 node, Got empty graph."
            raise ValueError(msg)

        self._tf_ssa = self._tf_ssa_from_graph_def()

        del self._graph_def
        gc.collect()

        if self.debug:
            import graphviz

            dot_string = self._tf_ssa.get_dot_string(
                annotation=True, name_and_op_style=True, highlight_debug_nodes=[]
            )
            graphviz.Source(dot_string).view(
                filename="/tmp/ssa_before_tf_passes", cleanup=True
            )

        program = self._program_from_tf_ssa()
        logger.debug("program:\n{}".format(program))
        return program
Load TensorFlow model into MIL program.
coremltools/converters/mil/frontend/tensorflow/load.py