Is there some way to save best model only with tensorflow.estimator.train_and_evaluate()?

前端 未结 3 1719
耶瑟儿~
耶瑟儿~ 2021-02-09 10:46

I try retrain TF Object Detection API model from checkpoint with already .config file for training pipeline with tf.estimator.train_and_evaluate() method like in models/research

3条回答
  •  借酒劲吻你
    2021-02-09 11:13

    You can try using BestExporter. As far as I know, it's the only option for what you're trying to do.

    exporter = tf.estimator.BestExporter(
          compare_fn=_loss_smaller,
          exports_to_keep=5)
    
    eval_spec = tf.estimator.EvalSpec(
        input_fn,
        steps,
        exporters)
    

    https://www.tensorflow.org/api_docs/python/tf/estimator/BestExporter

提交回复
热议问题