qhduan / Seq2Seq_Chatbot_QA

使用TensorFlow实现的Sequence to Sequence的聊天机器人模型
793 stars 275 forks source link

s2s一个小bug #23

Open narrowsnap opened 6 years ago

narrowsnap commented 6 years ago
ckpt = tf.train.get_checkpoint_state(FLAGS.model_dir)
print("ckpt path : ", ckpt.model_checkpoint_path)
if ckpt != None:
    print("load old model : ", ckpt.model_checkpoint_path)
    model.saver.restore(sess, ckpt.model_checkpoint_path)

第二行print,在ckpt为None时报错:

AttributeError: 'NoneType' object has no attribute 'model_checkpoint_path'