From 7bcc50d4393a65d47849ca5738dddfed3247f6fb Mon Sep 17 00:00:00 2001
From: Martin Englund <martin@englund.nu>
Date: Wed, 31 Aug 2016 21:23:33 -0700
Subject: [PATCH 1/3] improve error message when a category is empty

---
 tensorflow/examples/image_retraining/retrain.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tensorflow/examples/image_retraining/retrain.py b/tensorflow/examples/image_retraining/retrain.py
index acd3005c483..02c2ba91edd 100644
--- a/tensorflow/examples/image_retraining/retrain.py
+++ b/tensorflow/examples/image_retraining/retrain.py
@@ -268,7 +268,7 @@ def get_image_path(image_lists, label_name, index, image_dir, category):
     tf.logging.fatal('Category does not exist %s.', category)
   category_list = label_lists[category]
   if not category_list:
-    tf.logging.fatal('Category has no images - %s.', category)
+    tf.logging.fatal('Category %s has no images - %s.', label_name, category)
   mod_index = index % len(category_list)
   base_name = category_list[mod_index]
   sub_dir = label_lists['dir']

From 987128f2e1a908bb148386d0406f789c7bdb03e1 Mon Sep 17 00:00:00 2001
From: Martin Englund <martin@englund.nu>
Date: Fri, 2 Sep 2016 16:52:22 -0700
Subject: [PATCH 2/3] clarify error message

---
 tensorflow/examples/image_retraining/retrain.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tensorflow/examples/image_retraining/retrain.py b/tensorflow/examples/image_retraining/retrain.py
index 02c2ba91edd..4e11841acb1 100644
--- a/tensorflow/examples/image_retraining/retrain.py
+++ b/tensorflow/examples/image_retraining/retrain.py
@@ -268,7 +268,7 @@ def get_image_path(image_lists, label_name, index, image_dir, category):
     tf.logging.fatal('Category does not exist %s.', category)
   category_list = label_lists[category]
   if not category_list:
-    tf.logging.fatal('Category %s has no images - %s.', label_name, category)
+    tf.logging.fatal('Label %s has no images in the category %s.', label_name, category)
   mod_index = index % len(category_list)
   base_name = category_list[mod_index]
   sub_dir = label_lists['dir']

From 406bfe4c6e90b294c7f42aa2330f809b19f4c3b9 Mon Sep 17 00:00:00 2001
From: Martin Englund <martin@englund.nu>
Date: Sat, 3 Sep 2016 14:03:02 -0700
Subject: [PATCH 3/3] stick to 80 columnsi wide

---
 tensorflow/examples/image_retraining/retrain.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tensorflow/examples/image_retraining/retrain.py b/tensorflow/examples/image_retraining/retrain.py
index 4e11841acb1..3becd7f5721 100644
--- a/tensorflow/examples/image_retraining/retrain.py
+++ b/tensorflow/examples/image_retraining/retrain.py
@@ -268,7 +268,8 @@ def get_image_path(image_lists, label_name, index, image_dir, category):
     tf.logging.fatal('Category does not exist %s.', category)
   category_list = label_lists[category]
   if not category_list:
-    tf.logging.fatal('Label %s has no images in the category %s.', label_name, category)
+    tf.logging.fatal('Label %s has no images in the category %s.',
+                     label_name, category)
   mod_index = index % len(category_list)
   base_name = category_list[mod_index]
   sub_dir = label_lists['dir']