bert代码学习
程序员文章站
2022-05-14 17:16:50
...
1 bert训练的时候打出日志
基于官方的https://github.com/google-research/bert/issues/70
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=10)
output_spec = tf.contrib.tpu.TPUEstimatorSpec(
mode=mode,
loss=total_loss,
train_op=train_op,
training_hooks=[logging_hook],
scaffold_fn=scaffold_fn)
tensorflow版本1.11
上一篇: web.py学习笔记
下一篇: 基本数据结构算法