output_node = graph_pb2.NodeDef() AttributeError: 'module' object has no attribute 'NodeDef'

来源:互联网 发布:知到生态文明答案 编辑:程序博客网 时间:2024/05/02 04:27

tensorflow 0.11版运行 freeze_graph.py 出现 output_node = graph_pb2.NodeDef() AttributeError: 'module' object has no attribute 'NodeDef'

这个问题时,请将 freeze_graph.py中的

from tensorflow.python.client import graph_util
修改为

from tensorflow.python.framework import graph_util原因是在tensorflow的安装路径下 client 和 framework目录下都有 graph_util。但是 2个地方的实现不同。在 写图时  需要from tensorflow.python.framework import graph_util

0 0