aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/examples/image_retraining
diff options
context:
space:
mode:
authorGravatar Dan Ringwalt <ringwalt@google.com>2017-05-05 09:09:05 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-05-05 10:26:00 -0700
commit692fad20f913ffa2cb874a87578ecabb03cc4557 (patch)
tree172717f537c91b0d1ac0366731b4eb2093fb743b /tensorflow/examples/image_retraining
parentb329dd821e29e64c93b1b9bf38e61871c6cb53da (diff)
Merge changes from github.
Change: 155209832
Diffstat (limited to 'tensorflow/examples/image_retraining')
-rw-r--r--tensorflow/examples/image_retraining/retrain.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/tensorflow/examples/image_retraining/retrain.py b/tensorflow/examples/image_retraining/retrain.py
index 5f4b6bed48..6c1b40b442 100644
--- a/tensorflow/examples/image_retraining/retrain.py
+++ b/tensorflow/examples/image_retraining/retrain.py
@@ -369,9 +369,12 @@ def create_bottleneck_file(bottleneck_path, image_lists, label_name, index,
if not gfile.Exists(image_path):
tf.logging.fatal('File does not exist %s', image_path)
image_data = gfile.FastGFile(image_path, 'rb').read()
- bottleneck_values = run_bottleneck_on_image(sess, image_data,
- jpeg_data_tensor,
- bottleneck_tensor)
+ try:
+ bottleneck_values = run_bottleneck_on_image(
+ sess, image_data, jpeg_data_tensor, bottleneck_tensor)
+ except:
+ raise RuntimeError('Error during processing file %s' % image_path)
+
bottleneck_string = ','.join(str(x) for x in bottleneck_values)
with open(bottleneck_path, 'w') as bottleneck_file:
bottleneck_file.write(bottleneck_string)