tf.contrib.framework.assign_from_checkpoint_fn
Stay organized with collections
Save and categorize content based on your preferences.
Returns a function that assigns specific variables from a checkpoint.
tf.contrib.framework.assign_from_checkpoint_fn(
model_path, var_list, ignore_missing_vars=False, reshape_variables=False
)
If ignore_missing_vars is True and no variables are found in the checkpoint
it returns None.
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 Variable objects or a dictionary mapping names in the
checkpoint to the corresponding variables to initialize. If empty or
None , it would return no_op(), None .
|
ignore_missing_vars
|
Boolean, if True it would ignore variables missing in
the checkpoint with a warning instead of failing.
|
reshape_variables
|
Boolean, if True it would automatically reshape variables
which are of different shape then the ones stored in the checkpoint but
which have the same number of elements.
|
Returns |
A function that takes a single argument, a tf.compat.v1.Session , that
applies the
assignment operation. If no matching variables were found in the checkpoint
then None is returned.
|
Raises |
ValueError
|
If var_list is empty.
|
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."],[],[]]