0

运行以下示例后:

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)

引发以下错误:raise RuntimeError("Graph is finalized and cannot be modified.")

张量流版本:'2.2.0'

4

0 回答 0