'Args:
config (PredictConfig): the config to use.
towers: a list of relative GPU id.'

def __init__(self, config, towers):

    assert (len(towers) > 0)
    self.graph = config._maybe_create_graph()
    self.predictors = []
    self.return_input = config.return_input
    with self.graph.as_default():
        handles = []
        factory = PredictorFactory(config.model, towers)
        for (idx, t) in enumerate(towers):
            tower_name = ('tower' + str(t))
            device = ('/gpu:' + str(t))
            with tf.variable_scope(tf.get_variable_scope(), reuse=(idx > 0)):
                handles.append(factory.build(tower_name, device))
        self.sess = config.session_creator.create_session()
        config.session_init.init(self.sess)
        for h in handles:
            input_tensors = h.get_tensors(config.input_names)
            output_tensors = h.get_tensors(config.output_names)
            self.predictors.append(OnlinePredictor(input_tensors, output_tensors, config.return_input, self.sess))
