诗人的张量流

2024-10-05 13:16:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试做诗人的Tensorflow教程,我在第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."**

我已经试过打开标签了_图片.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."


Tags: nameinpyinputliblocalasline
1条回答
网友
1楼 · 发布于 2024-10-05 13:16:50

很明显,这个层是错的,看看official github,他们用了“input”这个名字,也许可以。如果这不起作用,您需要加载到您的模型中并检查张力板图,如果您遵循了教程,那么您很可能已经这样做了。从图中可以清楚地看出你的输入张量是哪一个,第一个。如果不行,就告诉我

相关问题 更多 >

    热门问题