500 步后,Tensorflow 无法编写摘要

After 500 steps Tensorflow fail to write summaries

我尝试在 tensorflow 中训练;我用这段代码将结果写入张量板:

   test_writer.add_summary(summary_strTest, i)
   train_writer.add_summary(summary_str, i)
   train_writer.flush()
   test_writer.flush()

500步后开始报错(写总结):

tensorflow/core/util/events_writer.cc:97] Write failed because file could not be opened.
E tensorflow/core/util/events_writer.cc:63] Could not open events file: ./logs/train/events.out.tfevents.1468372504.al: Resource exhausted: ./logs/train/

我看到资源耗尽是因为内存不足,但我有超过 2GB 的可用空间

然后在 100 步之后,当它必须写入检查点时它崩溃了。

在终端的 tensorboard 服务器上,我收到这条消息:

WARNING:tensorflow:Found more than one graph event per run. Overwriting the graph with the newest event.

不知道为什么500步后不能写入文件。我的logs文件夹,test,train在运行.

之后各有505个文件

所以解决办法就是减小batch的大小。我将它减少到 100,然后写入文件。