See the guide: Building Graphs > Graph collections
Standard names to use for graph collections.
The standard library uses various well-known names to collect and
retrieve values associated with a graph. For example, the
tf.Optimizer subclasses default to optimizing the variables
tf.GraphKeys.TRAINABLE_VARIABLES if none is
specified, but it is also possible to pass an explicit list of
The following standard keys are defined:
GLOBAL_VARIABLES: the default collection of
Variableobjects, shared across distributed environment (model variables are subset of these). See
tf.global_variablesfor more details. Commonly, all
TRAINABLE_VARIABLESvariables will be in
MODEL_VARIABLES, and all
MODEL_VARIABLESvariables will be in
LOCAL_VARIABLES: the subset of
Variableobjects that are local to each machine. Usually used for temporarily variables, like counters. Note: use
tf.contrib.framework.local_variableto add to this collection.
MODEL_VARIABLES: the subset of
Variableobjects that are used in the model for inference (feed forward). Note: use
tf.contrib.framework.model_variableto add to this collection.
TRAINABLE_VARIABLES: the subset of
Variableobjects that will be trained by an optimizer. See
tf.trainable_variablesfor more details.
SUMMARIES: the summary
Tensorobjects that have been created in the graph. See
tf.summary.merge_allfor more details.
QueueRunnerobjects that are used to produce input for a computation. See
tf.train.start_queue_runnersfor more details.
MOVING_AVERAGE_VARIABLES: the subset of
Variableobjects that will also keep moving averages. See
tf.moving_average_variablesfor more details.
REGULARIZATION_LOSSES: regularization losses collected during graph construction.
The following standard keys are defined, but their collections are not automatically populated as many of the others are: