tf api用法:stop_if_no_decrease_hook

时间:2018-12-11 04:43:13

标签: tensorflow

我想在对象检测中使用stop_if_no_decrease_hook tf api。

但是我不能停止训练过程。

early_stopping = tf.contrib.estimator.stop_if_no_decrease_hook(
    estimator,
    metric_name='loss',
    max_steps_without_decrease=5,
    min_steps=0
)

early_stopping2 = tf.contrib.estimator.stop_if_lower_hook(
    estimator,
    metric_name='total_loss',
    threshold=10,
    eval_dir=None,
    min_steps=0,
    run_every_secs=60,
    run_every_steps=None
)

train_spec = tf.estimator.TrainSpec(
    input_fn=train_input_fn, max_steps=train_steps, hooks=[early_stopping, early_stopping2])

metric_name更改为“ loss”,“ loss_1”,“ loss_2”,“ total_loss” 但是,我不能

1 个答案:

答案 0 :(得分:0)

+61 1 1234 5678