使用TPUEstimator训练时如何进行验证

时间:2019-04-04 03:40:41

标签: validation tpu

我正在使用TPUEstimator进行培训。 我的代码是:

estimator = tf.contrib.tpu.TPUEstimator(use_tpu=FLAGS.use_tpu, model_fn=model_fn, config=run_config,` train_batch_size=FLAGS.train_batch_size, eval_batch_size=FLAGS.eval_batch_size, predict_batch_size=FLAGS.predict_batch_size)

estimator.train(input_fn=train_input_fn, max_steps=num_train_steps)

我尝试使用InMemoryEvaluatorHook。

train_hook = tf.estimator.experimental.InMemoryEvaluatorHook(estimator, eval_input_fn, steps=FLAGS.save_checkpoints_steps, every_n_iter=1)

estimator.train(input_fn=train_input_fn, max_steps=num_train_steps, hooks=[train_hook])

但是我没有得到任何结果

0 个答案:

没有答案
相关问题