【问题标题】:TensorFlow retrain label_image.py (Simple image classification with Inception)TensorFlow retrain label_image.py(使用 Inception 进行简单图像分类)
【发布时间】:2018-04-07 20:31:27
【问题描述】:

用于标记对象,

如果我使用 TensorFlow 的 label_image.py 如下:

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

错误:KeyError:“名称‘final_result:0’指的是一个不存在的张量。操作‘final_result’在图中不存在。”

参考链接:https://github.com/tensorflow/tensorflow/blob/r1.3/tensorflow/examples/image_retraining/label_image.py

【问题讨论】:

  • 我在 TensorFlow 存储库中看不到 label_model.py。你能包含一个指向你正在运行的代码的指针吗?
  • 链接指出
  • 你重新训练过 inception 吗?

标签: python tensorflow gcloud tensorboard google-cloud-ml-engine


【解决方案1】:

您缺少在训练期间使用的输出层参数。 试试

`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`

【讨论】:

  • 这是硬编码到应用程序中的,是的,我正在使用--output_layer=final_result:0 参数
猜你喜欢
  • 2018-01-23
  • 1970-01-01
  • 2018-03-10
  • 2018-07-23
  • 2016-04-19
  • 2018-03-07
  • 2019-08-07
  • 2018-11-27
  • 1970-01-01
相关资源
最近更新 更多