Reputation: 11
I'm trying to run this example (https://github.com/tensorflow/models/tree/master/textsum). when I run this statement:
bazel-bin/textsum/seq2seq_attention \
--mode=train \
--article_key=article \
--abstract_key=abstract \
--data_path=data/training-* \
--vocab_path=data/vocab \
--log_root=textsum/log_root \
--train_dir=textsum/log_root/train
I see the following output
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "/home/depiano/Scrivania/TextSummarization/bazel-bin/textsum/seq2seq_attention.runfiles/__main__/textsum/seq2seq_attention.py", line 196, in main
_Train(model, batcher)
File "/home/depiano/Scrivania/TextSummarization/bazel-bin/textsum/seq2seq_attention.runfiles/__main__/textsum/seq2seq_attention.py", line 98, in _Train
allow_soft_placement=True))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/supervisor.py", line 715, in prepare_or_wait_for_session
init_feed_dict=self._init_feed_dict, init_fn=self._init_fn)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/session_manager.py", line 227, in prepare_session
config=config)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/session_manager.py", line 173, in _restore_checkpoint
saver.restore(sess, ckpt.model_checkpoint_path)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/saver.py", line 1342, in restore
"File path is: %r" % (save_path, file_path))
ValueError: Restore called with invalid save path: u'textsum/log_root/model.ckpt-0'. File path is: u'textsum/log_root/model.ckpt-0'
Errore di segmentazione (core dump creato)
Upvotes: 0
Views: 196
Reputation: 4201
Here what happens is tensorflow trying to load previously saved parameters in to the graph module.They can be architectural details and other initialization things. This is how tf test if there's a pretrained module
ckpt =tf.train.get_checkpoint_state(os.path.dirname('c/checkpointsq'))
# if that checkpoint exists, restore from checkpoint
if ckpt and ckpt.model_checkpoint_path:
print("Restoring the checkpoins")
saver.restore(sess, ckpt.model_checkpoint_path)
Here the first function will return a ckpt file object if there's any file called checkpoint. It's text file. Inside it there will be details of your network. So you have to correct the log directory in your case.
Upvotes: 0
Reputation: 45
The error indicates your model file textsum/log_root/model.ckpt-0
does not exist or can not be created. Make sure the directory textsum/log_root
exist.
Upvotes: 1