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

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

你可能感兴趣的:(tensorflow,ubuntu,python)