Assign total_loss in order not to crash if training loop exists early.
authorA. Unique TensorFlower <gardener@tensorflow.org>
Mon, 5 Feb 2018 23:30:54 +0000 (15:30 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 5 Feb 2018 23:34:40 +0000 (15:34 -0800)
PiperOrigin-RevId: 184596877

tensorflow/contrib/slim/python/slim/learning.py

index 54362c8..83f3380 100644 (file)
@@ -738,6 +738,7 @@ def train(train_op,
   if summary_writer is not None:
     train_step_kwargs['summary_writer'] = sv.summary_writer
 
+  total_loss = 0
   should_retry = True
   while should_retry:
     try: