tf.contrib.framework.assign_from_checkpoint
Stay organized with collections
Save and categorize content based on your preferences.
Creates an operation to assign specific variables from a checkpoint.
tf.contrib.framework.assign_from_checkpoint(
model_path, var_list, ignore_missing_vars=False
)
Args |
model_path
|
The full path to the model checkpoint. To get latest checkpoint
use model_path = tf.train.latest_checkpoint(checkpoint_dir)
|
var_list
|
A list of (possibly partitioned) Variable objects or a
dictionary mapping names in the checkpoint to the corresponding variables
or list of variables to initialize from that checkpoint value. For
partitioned Variables, the name in the checkpoint must be the full
variable, not the name of the partitioned variable, eg. "my_var" rather
than "my_var/part_4". If empty, returns no_op(), {}.
|
ignore_missing_vars
|
Boolean, if True ignore variables missing in the
checkpoint with a warning instead of failing.
|
Returns |
the restore_op and the feed_dict that need to be run to restore var_list.
|
Raises |
ValueError
|
If ignore_missing_vars is False and the checkpoint specified
at model_path is missing one of the variables in var_list .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[]]