From 51279cf5b2ee2fbb67ea49905fa2c43ce88e4056 Mon Sep 17 00:00:00 2001 From: Adam Bouhenguel Date: Sun, 6 Aug 2017 07:44:57 -0700 Subject: [PATCH] Fix Python3 support in model_builder.py Use six.iteritems(...) instead of losses_dict.iteritems() --- tensor2tensor/utils/model_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensor2tensor/utils/model_builder.py b/tensor2tensor/utils/model_builder.py index a12aa1122..48d5dd7a0 100644 --- a/tensor2tensor/utils/model_builder.py +++ b/tensor2tensor/utils/model_builder.py @@ -195,7 +195,7 @@ def nth_model(n): features, skip=(skipping_is_on and skip_this_one)) with tf.variable_scope("losses_avg", reuse=True): total_loss, ops = 0.0, [] - for loss_key, loss_value in losses_dict.iteritems(): + for loss_key, loss_value in six.iteritems(losses_dict): loss_moving_avg = tf.get_variable("problem_%d/%s_loss" % (n, loss_key)) ops.append(