od_graph_def = tf.GraphDef() AttributeError: module ‘tensorflow’ has no attribute ‘GraphDef’

Yeah, the syntax has changed in T2.0. Here’s the correct piece:

tf.compat.v1.GraphDef()   # -> instead of tf.GraphDef()
tf.compat.v2.io.gfile.GFile()   # -> instead of tf.gfile.GFile()

Leave a Comment