我正在尝试运行这个示例(https://github.com/tensorflow/models/tree/master/textsum)。当我运行以下语句时:
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我看到以下输出
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)发布于 2017-03-19 04:21:31
该错误指示您的模型文件textsum/log_root/model.ckpt-0不存在或无法创建。确保目录textsum/log_root存在。
发布于 2017-04-05 03:21:24
这里发生的是tensorflow试图将先前保存的参数加载到图中,module.They可以是体系结构细节和其他初始化内容。这就是tf测试是否存在预训练模块的方法
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) 在这里,第一个函数将返回一个ckpt文件对象,如果有任何名为checkpoint的文件。这是文本文件。在它里面会有你的网络的细节。因此,在您的情况下,您必须更正日志目录。
https://stackoverflow.com/questions/42807571
复制相似问题