bert_max_doc_str_max_str_pos_clean_doc_noise_doc/run_doc_qa.py
def initialize_from_checkpoint(self, init_checkpoint):
        """Initializes model variables from init_checkpoint."""
        variables_to_restore = tf.trainable_variables()

        if init_checkpoint:
            tf.logging.info(
                "Initializing the model from {0}".format(init_checkpoint))
            (assignment_map, initialized_variable_names
             ) = modeling.get_assignment_map_from_checkpoint(
                 variables_to_restore, init_checkpoint
             )

            # TODO(chenghao): Currently, no TPU is supported.
            tf.train.init_from_checkpoint(init_checkpoint, assignment_map)

        tf.logging.info("**** Trainable Variables ****")
        for var in variables_to_restore:
            init_string = ""
            if var.name in initialized_variable_names:
                init_string = ", *INIT_FROM_CKPT*"
            tf.logging.info("  name = %s, shape = %s%s", var.name, var.shape,
                            init_string)
Initializes model variables from init_checkpoint.
Initializes model variables from init_checkpoint.
Initializes model variables from init_checkpoint .
def initialize_from_checkpoint(self, init_checkpoint):
        variables_to_restore = tf.trainable_variables()
        if init_checkpoint:
            tf.logging.info(
                "Initializing the model from {0}".format(init_checkpoint))
            (assignment_map, initialized_variable_names
             ) = modeling.get_assignment_map_from_checkpoint(
                 variables_to_restore, init_checkpoint
             )
            tf.train.init_from_checkpoint(init_checkpoint, assignment_map)
        tf.logging.info("**** Trainable Variables ****")
        for var in variables_to_restore:
            init_string = ""
            if var.name in initialized_variable_names:
                init_string = ", *INIT_FROM_CKPT*"
            tf.logging.info("  name = %s, shape = %s%s", var.name, var.shape,
                            init_string)
def initialize_from_checkpoint ( self , init_checkpoint ) : variables_to_restore = tf . trainable_variables ( ) if init_checkpoint : tf . logging . info ( "Initializing the model from {0}" . format ( init_checkpoint ) ) ( assignment_map , initialized_variable_names ) = modeling . get_assignment_map_from_checkpoint ( variables_to_restore , init_checkpoint ) tf . train . init_from_checkpoint ( init_checkpoint , assignment_map ) tf . logging . info ( "**** Trainable Variables ****" ) for var in variables_to_restore : init_string = "" if var . name in initialized_variable_names : init_string = ", *INIT_FROM_CKPT*" tf . logging . info ( "  name = %s, shape = %s%s" , var . name , var . shape , init_string )
Initializes model variables from init_checkpoint.
Initializes model variables from init_checkpoint .
"""Initializes model variables from init_checkpoint.""" # TODO(chenghao): Currently, no TPU is supported.
self
init_checkpoint