Estimator 训练期间的验证 [英] validation during training of Estimator

查看:38
本文介绍了Estimator 训练期间的验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不推荐使用 TensorFlow r1.3 监视器:

With the TensorFlow r1.3 monitors are deprecated:

"2016-12-05",不推荐使用监视器.请使用 tf.train.SessionRunHook.")而 Estimator.train(input_fn,hooks,..) 仅适用于钩子.

"2016-12-05", "Monitors are deprecated. Please use tf.train.SessionRunHook.") and Estimator.train(input_fn,hooks,..) works only with hooks.

如何使用钩子实现验证监视器的功能?

How to implement the functionality of validation monitor with hooks?

推荐答案

我一直在使用 SummarySaverHook 而不是 Monitors.它们还没有那么强大",而且培训材料还没有更新,其中没有关于如何准确复制 Monitor 功能的描述.

I have been using SummarySaverHook instead of Monitors. They are not "as powerful" just yet, and the training material has not been updated with a description on how exactly replicate the Monitor functionality.

这是我如何使用它:

summary_hook = tf.train.SummarySaverHook(
    save_steps=SAVE_EVERY_N_STEPS,
    output_dir='./tmp/rnnStats',
    scaffold=tf.train.Scaffold(),
    summary_op=tf.summary.merge_all())

print("Classifier.train")
classifier.train(input_fn=train_input_fn, steps=1000, hooks=[summary_hook])

这篇关于Estimator 训练期间的验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆