Only measure words per second during training
@@ -68,6 +68,7 @@ class Model(object):
"""Creates the model. See `tf.estimator.Estimator`'s `model_fn` argument
for more details about arguments and the returned value.
"""
+ if mode == tf.estimator.ModeKeys.TRAIN:
self._register_word_counters(features, labels)
with tf.variable_scope(self.name):
return self._build(features, labels, params, mode, config)
