【发布时间】:2019-10-05 14:16:32
【问题描述】:
我正在开发的部分对象检测应用程序中使用以下功能
detection_graph = tf.Graph()
with detection_graph.as_default():
od_graph_def = tf.GraphDef()
with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid:
serialized_graph = fid.read()
od_graph_def.ParseFromString(serialized_graph)
tf.import_graph_def(od_graph_def, name='')
当我运行此代码时,我收到以下错误:
AttributeError Traceback (most recent call last)
<ipython-input-6-d55b98fd5a78> in <module>
1 detection_graph = tf.Graph()
2 with detection_graph.as_default():
----> 3 od_graph_def = tf.GraphDef()
4 with tf.gfile.GFile(PATH_TO_FROZEN_GRAPH, 'rb') as fid:
5 serialized_graph = fid.read()
AttributeError: module 'tensorflow' has no attribute 'GraphDef'
我使用的是 TensorFlow 2.0.0。这与版本不匹配有关吗?
此代码来自以下link。
【问题讨论】:
标签: tensorflow machine-learning object-detection