如何在tf.contrib.learn Estimator中关闭events.out.tfevents文件

JJ *_*key 7 python tensorflow

当使用estimator.Estimatortensorflow.contrib.learn,训练和预测后有在这些文件modeldir:

  • 检查站
  • events.out.tfevents.1487956647
  • events.out.tfevents.1487957016
  • graph.pbtxt
  • model.ckpt-101.data 00000-的-00001
  • model.ckpt-101.index
  • model.ckpt-101.meta

当图形复杂或变量数量很大时,graph.pbtxt文件和事件文件可能非常大.这是一种不写这些文件的方法吗?由于模型重新加载只需要删除检查点文件,因此不会影响评估和预测.

Tri*_*yen 1

如果您不想写入 events.out.tfevents 文件。在您的代码中找到类似的内容并将其删除。

tfFileWriter = tf.summary.FileWriter(os.getcwd())
tfFileWriter.add_graph(sess.graph)
tfFileWriter.close()
Run Code Online (Sandbox Code Playgroud)