TensorFlow retrain label_image.py (Simple image classification with Inception)

1.6k Views Asked by At

For labelling objects,

If I use TensorFlow's label_image.py like:

    $ python label_image.py --image=1.jpg --graph=output_inference_graph.pb/frozen_inference_graph.pb --labels=test.txt

Error: KeyError: "The name 'final_result:0' refers to a Tensor which does not exist. The operation, 'final_result', does not exist in the graph."

Reference link:https://github.com/tensorflow/tensorflow/blob/r1.3/tensorflow/examples/image_retraining/label_image.py

1

There are 1 best solutions below

1
Muhammad Hannan On

You are missing output layer parameter which you have use during your training. Try

`bazel-bin/tensorflow/examples/image_retraining/label_image \
--graph=/tmp/your_output_graph.pb 
--labels=/tmp/your_output_labels.txt \
--output_layer=final_result:0 \
--image=path_to_your_imahe.jpg`