一、变量相关的函数
1)tf.train.list_variables(ckpt_dir_or_file) Returns list of all variables in the checkpoint
2)tf.global_variables_initializer() 用于初始化所有的变量(GraphKeys.VARIABLES),替代 tf.initialize_all_variables()。
3)tf.Variable(initial_value=None, trainable=True, collections=None, validate_shape=True, caching_device=None, name=None, variable_def=None, dtype=None, expected_shape=None, import_scope=None) 构建一个变量
trainable: 默认为`True`,则默认值也将变量添加到图形中集合`GraphKeys.TRAINABLE_VARIABLES`。#这个集合用作“Optimizer”类使用的默认变量列表。
collections:图表集合键的列表。新的变量被添加到这些集合。默认为`[GraphKeys.GLOBAL_VARIABLES]`)
原文:https://www.cnblogs.com/gczr/p/11885901.html