BERT如何打印eval信息

BERT目前只有在所有训练结束后才会eval一次,
所以要把

flags.DEFINE_float("num_train_epochs", 3.0,
                   "Total number of training epochs to perform.")

改到比现在已训练步数小时,跑一下就可以看一次。

还要改下这个

flags.DEFINE_string(
    "init_checkpoint", 
    default="output_dir/model.ckpt-10000",
    help="Initial checkpoint (usually from a pre-trained BERT model).")

以及output_dir/checkpoint的第一行,对应上。

或者貌似直接

flags.DEFINE_bool("do_train", False, "Whether to run training.")

flags.DEFINE_bool("do_eval", True, "Whether to run eval on the dev set.")

————
https://github.com/google-research/bert

发布了1142 篇原创文章 · 获赞 196 · 访问量 260万+

猜你喜欢

转载自blog.csdn.net/guotong1988/article/details/103065599
今日推荐