def load_chkpt_vars(model_path):
    """ Load all variables from a checkpoint to a dict.

    Args:
        model_path(str): path to a checkpoint.

    Returns:
        dict: a name:value dict
    """
    model_path = get_checkpoint_path(model_path)
    reader = tfv1.train.NewCheckpointReader(model_path)
    var_names = reader.get_variable_to_shape_map().keys()
    result = {}
    for n in var_names:
        result[n] = reader.get_tensor(n)
    return result
def load_chkpt_vars ( model_path ) : model_path = get_checkpoint_path ( model_path ) reader = tfv1 . train . NewCheckpointReader ( model_path ) var_names = reader . get_variable_to_shape_map ( ) . keys ( ) result = { } for n in var_names : result [ n ] = reader . get_tensor ( n ) return result
Load all variables from a checkpoint to a dict.

    Args:
        model_path(str): path to a checkpoint.

    Returns:
        dict: a name:value dict