Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

Fix problem_0_steps in checkpoint averages #1273

Merged
merged 2 commits into from
Dec 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tensor2tensor/bin/t2t_avg_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ def main(_):
var_list = tf.contrib.framework.list_variables(model.filename)
avg_values = {}
for (name, shape) in var_list:
if not name.startswith("global_step"):
if not (name.startswith("global_step") or
name.startswith("train_stats/")):
avg_values[name] = np.zeros(shape)
models_processed += 1

Expand All @@ -88,6 +89,8 @@ def main(_):
"global_step",
initializer=tf.constant(model.steps, dtype=tf.int64),
trainable=False)
with tf.variable_scope("train_stats"):
tf.get_variable("problem_0_steps", initializer=0, trainable=False)
saver = tf.train.Saver(tf.global_variables())

tf.logging.info("Running session for %s" % (out_file))
Expand Down