diff options
author | Geoffrey Irving <geoffreyi@google.com> | 2016-02-10 13:21:35 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-02-10 16:02:29 -0800 |
commit | b2757fb5797252bb1ef12bbf04be796cc83000cc (patch) | |
tree | 5865683f6f6c9b5c6904342e03e8f862d88bc32e /tensorflow/examples/label_image | |
parent | 9934b9c6841ee56368c7cb1d10053f68a02680ba (diff) |
Switch label_image to use TopKV2 instead of TopK
Fixes #1040. I need to file a further bug so that deprecated ops are removed
from the C++ API entirely, similar to what we do in Python.
Change: 114360963
Diffstat (limited to 'tensorflow/examples/label_image')
-rw-r--r-- | tensorflow/examples/label_image/main.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/examples/label_image/main.cc b/tensorflow/examples/label_image/main.cc index 9f66d1e7ac..424a594059 100644 --- a/tensorflow/examples/label_image/main.cc +++ b/tensorflow/examples/label_image/main.cc @@ -161,8 +161,9 @@ Status GetTopLabels(const std::vector<Tensor>& outputs, int how_many_labels, Tensor* indices, Tensor* scores) { tensorflow::GraphDefBuilder b; string output_name = "top_k"; - tensorflow::ops::TopK(tensorflow::ops::Const(outputs[0], b.opts()), - how_many_labels, b.opts().WithName(output_name)); + tensorflow::ops::TopKV2(tensorflow::ops::Const(outputs[0], b.opts()), + tensorflow::ops::Const(how_many_labels, b.opts()), + b.opts().WithName(output_name)); // This runs the GraphDef network definition that we've just constructed, and // returns the results in the output tensors. tensorflow::GraphDef graph; |