After running below sample:
def embed_muse(module):
with tf.Graph().as_default():
sentences = tf.placeholder(tf.string)
embed = hub.load(module)
embeddings = embed(sentences)
session = tf.train.MonitoredSession()
return lambda x: session.run(embeddings)
embed_fn = embed_muse(module)
messages = [
"we are sorry for the inconvenience",
"we are sorry for the delay",
"we regret for your inconvenience",
"we don't deliver to baner region in pune",
"we will get you the best possible rate"
]
embed_fn(messages)
following error raised:
raise RuntimeError("Graph is finalized and cannot be modified.")
Tensorflow version:'2.2.0'
question from:
https://stackoverflow.com/questions/65559717/runtimeerror-graph-is-finalized-and-cannot-be-modified 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…