practical_seq2seq icon indicating copy to clipboard operation
practical_seq2seq copied to clipboard

Your checkpoints doesn't work

Open Jatapiaro opened this issue 7 years ago • 7 comments

!!

Jatapiaro avatar May 01 '17 09:05 Jatapiaro

I am facing the same issues

karanpande avatar Oct 03 '17 16:10 karanpande

Hey I was having this problem too.

Turns out that running the code straight will not give you an error if you haven't actually loaded the checkpoint file since the code will skip over the loading if it doesn't find the files.

 def restore_last_session(self):
    saver = tf.train.Saver()
    # create a session
    sess = tf.Session()
    # get checkpoint state
    ckpt = tf.train.get_checkpoint_state(self.ckpt_path) 
    # restore session
    if ckpt and ckpt.model_checkpoint_path: [<<<<<<<<<<<<<]
        saver.restore(sess, ckpt.model_checkpoint_path)
    # return to user
    return sess

To fix it this issue, you need to do either one of the following after pulling and decompressing the model.

make sure to either have all the ckpt files directly in the ckpt folder

modify the ckpt_path (line 29 in chatbot.py) to be

ckpt = 'ckpt/seq2seq_twitter_1024x3h_i43000' *assuming that your uncompressed folder is named the same as mine. If not then change seq2seq_twitter_1024x3h_i43000 to whatever you've named it.

That solved my problem and will likely fix yours.

nunezpaul avatar Nov 14 '17 03:11 nunezpaul

@nunezpaul Thank you so much for your response, can i know which tensorflow version you are on? It still does not work for me.

karanpande avatar Nov 15 '17 20:11 karanpande

I'm using tensorflow 0.12.1. Even though it was written for 0.12.0, it still should work.

nunezpaul avatar Nov 15 '17 20:11 nunezpaul

I did the change as you mentioned, put all uncompressed files in the folder 'ckpt/seq2seq_twitter_1024x3h_i43000/' which contains checkpoint,meta,ckpt and index files. Error: Assign requires shapes of both tensors to match. lhs shape= [6002,1024] rhs shape= [8002,1024] This is the error i get on the restore , can you help me.

karanpande avatar Nov 15 '17 21:11 karanpande

Definitely not an error I got. Sounds like you played around some of the settings and left the changes? The model should work if you haven't touched anything else.

As a test, you should be able to import chatbot.py and get a valid response from chatbot.respond('say something')

nunezpaul avatar Nov 15 '17 21:11 nunezpaul

Hi, I am facing same problem with no matching shapes, have you found a solution for that ?

amiralessigue avatar Apr 16 '19 13:04 amiralessigue