|View source on GitHub|
tf.Variable initializers so they load from a checkpoint file.
tf.compat.v1.train.init_from_checkpoint( ckpt_dir_or_file, assignment_map )
Values are not loaded immediately, but when the initializer is run
(typically by running a
Assignment map supports following syntax:
'checkpoint_scope_name/': 'scope_name/'- will load all variables in current
checkpoint_scope_namewith matching tensor names.
'checkpoint_scope_name/some_other_variable': 'scope_name/variable_name'- will initialize
'scope_variable_name': variable- will initialize given
tf.Variableobject with tensor 'scope_variable_name' from the checkpoint.
'scope_variable_name': list(variable)- will initialize list of partitioned variables with tensor 'scope_variable_name' from the checkpoint.
'/': 'scope_name/'- will load all variables in current
scope_namefrom checkpoint's root (e.g. no scope).
Supports loading into partitioned variables, which are represented as
Assignment map can be a dict, or a list of pairs. The latter is necessary to initialize multiple variables in the current graph from the same variable in the checkpoint.