【问题标题】:Tensorflow for Poets label_image issue诗人 label_image 问题的 TensorFlow
【发布时间】:2019-03-07 17:16:00
【问题描述】:

我正在尝试编写 Tensorflow for Poets 教程,我正在使用重新训练的模型的第 6 步。我正在尝试运行此命令:

python -m scripts.label_image --graph=tf_files/retrained_graph.pb -- image=tf_files/flower_photos/daisy/21652746_cc379e0eea_m.jpg

并返回此错误:

2019-03-06 16:13:27.270248: I Tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Traceback (most recent call last):
File "C:\Users\rzara\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
 File "C:\Users\rzara\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\rzara\Documents\GitHub\tensorflow-for-poets- 2\scripts\label_image.py", line 121, in <module>
input_operation = graph.get_operation_by_name(input_name);
File "C:\Users\rzara\AppData\Local\Programs\Python\Python37\lib\site- packages\tensorflow\python\framework\ops.py", line 3606, in get_operation_by_name
return self.as_graph_element(name, allow_tensor=False, allow_operation=True)
File "C:\Users\rzara\AppData\Local\Programs\Python\Python37\lib\site- packages\tensorflow\python\framework\ops.py", line 3478, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "C:\Users\rzara\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\ops.py", line 3538, in 
_as_graph_element_locked
"graph." % repr(name))
**KeyError: "The name 'import/Mul' refers to an Operation not in the graph."**

我已经尝试打开 label_image.py 并进行更改:

input_height = 299
input_width = 299
input_layer = 'Mul'

但它仍然没有运行。请帮忙。我已经在这里查看了另一个帖子,但没有帮助:tensorflow for poets: "The name 'import/input' refers to an Operation not in the graph."

【问题讨论】:

    标签: python python-3.x tensorflow input


    【解决方案1】:

    显然层是错误的,查看official github,他们使用名称“输入”,也许可行。如果这不起作用,您需要加载模型并检查张量板图,如果您按照教程进行操作,那么您很可能已经这样做了。从图中应该清楚您的输入张量是哪个,第一个。如果它不起作用,请告诉我

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-18
      相关资源
      最近更新 更多