赞
踩
使用 logging_hook = tf.train.LoggingTensorHook({"loss":total_loss},every_n_iter=100)进行显示
- if mode == tf.estimator.ModeKeys.TRAIN:
- train_op = optimization.create_optimizer(
- total_loss, learning_rate, num_train_steps, num_warmup_steps, use_tpu)
- logging_hook = tf.train.LoggingTensorHook({"loss":total_loss},every_n_iter=100)
- output_spec = tf.contrib.tpu.TPUEstimatorSpec(
- mode=mode,
- loss=total_loss,
- train_op=train_op,
- training_hooks=[logging_hook],
- scaffold_fn=scaffold_fn)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。