-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restoring model from checkpoint #10
Comments
The train and test model share parameters, since you didn't load the train model, the test model would be randomly initialized, also you should create the models before restore. |
Hi @dianamurgulet, the "create_mode" function finds the model checkpoint from FLAGS.train_dir with ckpt = tf.train.get_checkpoint_state(FLAGS.train_dir). If you have a pre-trained model, just pass the model directory to this get_checkpoint_state function should make it work. |
Hi @HadoopIt , I tried to pass the model directory to "create_model" func at your suggestion, but it still didn't work. Then I read your code for restoring pre-trained model from disk in run_multi-task_rnn.py, and made some change: original code in run_multi-task_rnn.py, line 219: Then it works. I guess the reason may be ckpt.model_checkpoint_path = './model/model.ckpt-29900' and it doesn't exist. The files we need are with suffix '.data-00000-of-00001' , 'index', 'meta', which are exist in $train_dir. |
@pachirayz tf.gfile.Exists(ckpt.model_checkpoint_path) always false. maybe you should edit it |
ckpt.model_checkpoint_path |
@bringtree Thanks for pointing this out. I have just pushed a fix. |
@bringtree Yeah, that's what I mean. The second condition (tf.gfile.Exists(ckpt.model_checkpoint_path)) is always false because ckpt.model_checkpoint_path does not contains suffix , e.g 'index' as your example. |
Hi @HadoopIt ,
Thank you for publishing the code for the paper.
I am trying to use a stored pre-trained model to generate the intent and slots for a new sentence. However, based on the outputs it generates, it ends up using a new, untrained model.
Any suggestions on how to use a trained model from a stored file?
The text was updated successfully, but these errors were encountered: