gpt4 book ai didi

python - tensorflow 错误KeyError : "The name ' import/Mul' refers to an Operation not in the graph.“

转载 作者:行者123 更新时间:2023-11-30 08:48:42 25 4
gpt4 key购买 nike

我执行此命令是为了检查 tensorflow 训练的结果。

    python label_image.py --image xxx.jpg --graph retrained_graph.pb --labels retrained_labels.txt

并发现以下错误。

    /Users/xxx/anaconda3/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.      from ._conv import register_converters as _register_converters    2018-07-11 00:39:22.028051: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA    Traceback (most recent call last):      File "label_image.py", line 131, in         input_operation = graph.get_operation_by_name(input_name)      File "/Users/xxx/tensorFlow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3718, in get_operation_by_name        return self.as_graph_element(name, allow_tensor=False, allow_operation=True)      File "/Users/xxx/tensorFlow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3590, in as_graph_element        return self._as_graph_element_locked(obj, allow_tensor, allow_operation)      File "/Users/xxx/tensorFlow/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3650, 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_mean = 0      input_std = 255      input_layer = "Mul"      output_layer = "final_result"

最佳答案

python label_image.py --image cat3.jpg --graph retrained_graph.pb --labels retrained_labels.txt --input_layer=占位符

这条命令,问题解决了。

关于python - tensorflow 错误KeyError : "The name ' import/Mul' refers to an Operation not in the graph.“,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51269683/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com