RuntimeError: Attempted to use a closed Session.解决方法

解决方案

CASE 1

try:
    model.load("model.tflearn")
except:
    model.fit(training, output, n_epoch=1000, batch_size=8, show_metric=True)
    model.save("model.tflearn")

去掉

try:
    model.load("model.tflearn")
except:

CASE 2

with tf.Session(config=sess_config) as sess:
    fast_text = FastText(config)

换成

sess = tf.Session(config=sess_config) 
fast_text = FastText(config)

你可能感兴趣的:(BUG)