tf.contrib.framework.assign_from_checkpoint(model_path, var_list)
Creates an operation to assign specific variables from a checkpoint.
Args:
-
model_path
: The full path to the model checkpoint. To get latest checkpoint usemodel_path = tf.train.latest_checkpoint(checkpoint_dir)
-
var_list
: A list ofVariable
objects or a dictionary mapping names in the checkpoint to the correspoing variables to initialize. If empty or None, it would return no_op(), None.
Returns:
the restore_op and the feed_dict that need to be run to restore var_list.
Raises:
-
ValueError
: If the checkpoint specified atmodel_path
is missing one of the variables invar_list
.
Please login to continue.