gpt4 book ai didi

python - 如何关闭 tf.contrib.learn Estimator 中的 events.out.tfevents 文件

转载 作者:太空狗 更新时间:2023-10-29 21:56:17 25 4
gpt4 key购买 nike

tensorflow.contrib.learn 中使用 estimator.Estimator 时,在训练和预测之后,modeldir 中有这些文件: p>

  • 检查点
  • events.out.tfevents.1487956647
  • events.out.tfevents.1487957016
  • 图表.pbtxt
  • model.ckpt-101.data-00000-of-00001
  • model.ckpt-101.index
  • model.ckpt-101.meta

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

最佳答案

关于 Google's Machine Learning Crash Course他们使用以下方法:

# Create classifier:
classifier = tf.estimator.DNNRegressor(
feature_columns=feature_columns,
optimizer=optimizer
)

# Train it:
classifier.train(
input_fn=training_input_fn,
steps=steps
)

# Remove event files to save disk space.
_ = map(os.remove, glob.glob(os.path.join(classifier.model_dir, 'events.out.tfevents*')))

关于python - 如何关闭 tf.contrib.learn Estimator 中的 events.out.tfevents 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42444796/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com