通过更改tf.estimator.RunConfig 的配置项即可
run_config = tf.estimator.RunConfig(
model_dir=FLAGS.output_dir,
save_summary_steps=FLAGS.save_summary_steps,
save_checkpoints_steps=FLAGS.save_checkpoints_steps,
session_config=sess_config,
keep_checkpoint_max = 2 // 更改checkpoint数量
)