carpedm20/attentive-reader-tensorflow

Loading a check-pointed model?

dandxy89 opened this issue · 5 comments

I've trained a model and the model has saved in the correct folder.

When running python main.py --dataset cnn --forward_only True

I get the error:
`Traceback (most recent call last):
File "main.py", line 63, in
tf.app.run()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/default/_app.py", line 30, in run
sys.exit(main(sys.argv))
File "main.py", line 59, in main
model.load(sess, FLAGS.checkpoint_dir, FLAGS.dataset)
File "/home/dan/Desktop/attentive-reader-tensorflow/model/base_model.py", line 29, in load
self.saver = tf.train.Saver()
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 705, in init
raise ValueError("No variables to save")``

This came after resolving another issue in main.py.

model.load(FLAGS.checkpoint_dir) -> model.load(sess, FLAGS.checkpoint_dir, FLAGS.dataset)

I believe that load function is not working as expected. I think that the likely cause for this is the Session has not initialized with any variables and hence cannot instantiate the TF Saver function, causing the error above.

I plan to investigate further but want to see if you had an insight into this. Have you managed to load a model using this command?

@dandxy89 Thanks for noticing me this problem. Yes, you're right.

model.load(sess, FLAGS.checkpoint_dir, FLAGS.dataset)

is the right solution and this should be fixed. Loading a model can be done anytime after the graph is defined and it is not related to initialization. Also, I want to let you know that this project is still in progress and only deep lstm reader is implemented right now.

It's a very interesting project and as far as I can see the only one that using this dataset.

This hasn't resolved my issue though :(

I will try another machine...

I also have this problem. Has anyone been able to resolve this issue?

@rabberbock drop me and email.

Hi, sorry to bother you @dandxy89 but did this model work for you at the end? Thanks
Otherwise did you experience the error "ValueError: Shape (32, 768) must have rank 3". Antonio