validation during training of Estimator

前端 未结 2 852
一整个雨季
一整个雨季 2020-12-15 09:25

With the TensorFlow r1.3 monitors are deprecated:

\"2016-12-05\", \"Monitors are deprecated. Please use tf.train.SessionRunHook.\") and Estimator.train(input_f

2条回答
  •  难免孤独
    2020-12-15 09:56

    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.

    Here is how i use it:

    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])
    

提交回复
热议问题