aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Pete Warden <pete@petewarden.com>2016-02-22 17:14:17 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-02-23 09:57:37 -0800
commit93866d1407f31011d307bf3868ad72516419fea0 (patch)
tree367c715441e7ff27db76bf9b76f64446332ad036
parent5bd9073799436daa9275a2990e5df58a75a1aa78 (diff)
Updated image retraining documentation with usage example
Change: 115288487
-rw-r--r--tensorflow/g3doc/how_tos/image_retraining/index.md20
1 files changed, 19 insertions, 1 deletions
diff --git a/tensorflow/g3doc/how_tos/image_retraining/index.md b/tensorflow/g3doc/how_tos/image_retraining/index.md
index b1a72b879e..5a004b8c1e 100644
--- a/tensorflow/g3doc/how_tos/image_retraining/index.md
+++ b/tensorflow/g3doc/how_tos/image_retraining/index.md
@@ -117,13 +117,31 @@ to run since there's randomness in the training process. This number is based on
how many of the images in the test set are given the correct label after the
model is fully trained.
+## Using the Retrained Model
+
The script will write out a version of the Inception v3 network with a final
layer retrained to your categories to /tmp/output_graph.pb, and a text file
containing the labels to /tmp/output_labels.txt. These are both in a format that
the [C++ and Python image classification examples](https://www.tensorflow.org/versions/master/tutorials/image_recognition/index.html)
can read in, so you can start using your new model immediately. Since you've
replaced the top layer, you will need to specify the new name in the script, for
-example with the flag `--output_layer=final_output` if you're using label_image.
+example with the flag `--output_layer=final_result` if you're using label_image.
+
+Here's an example of how to build and run the label_image example with your
+retrained graphs:
+
+```sh
+bazel build tensorflow/examples/label_image:label_image && \
+bazel-bin/tensorflow/examples/label_image/label_image \
+--graph=/tmp/output_graph.pb --labels=/tmp/output_labels.txt \
+--output_layer=final_result \
+--image=$HOME/flower_photos/daisy/21652746_cc379e0eea_m.jpg
+```
+
+You should see a list of flower labels, in most cases with daisy on top
+(though each retrained model may be slightly different). You can replace the
+`--image` parameter with your own images to try those out, and use the C++ code
+as a template to integrate with your own applications.
## Training on Your Own Categories