suriyadeepan / practical_seq2seq

A simple, minimal wrapper for tensorflow's seq2seq module, for experimenting with datasets rapidly
http://suriyadeepan.github.io/2016-12-31-practical-seq2seq/
GNU General Public License v3.0
569 stars 270 forks source link

Your checkpoints doesn't work #32

Open Jatapiaro opened 7 years ago

Jatapiaro commented 7 years ago

!!

karanpande commented 6 years ago

I am facing the same issues

nunezpaul commented 6 years ago

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.

karanpande commented 6 years ago

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

nunezpaul commented 6 years ago

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

karanpande commented 6 years ago

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.

nunezpaul commented 6 years ago

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')

amiralessigue commented 5 years ago

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