Socialbird-AILab/BERT-Classification-Tutorial

验证的精度,只有0.1,为什么?

zy486at189cn opened this issue · 4 comments

使用的命令为:
python run_classifier.py --task_name=MRPC --do_train=true --do_eval=true --data_dir=data/ --vocab_file=uncased_L-12_H-768_A-12/vocab.txt --bert_config_file=uncased_L-12_H-768_A-12/bert_config.json --init_checkpoint=uncased_L-12_H-768_A-12/bert_model.ckpt --output_dir=mrpc_output/

结果如下:
2019-03-03 17:41:02.999284: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1103] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 9947 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1080 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
INFO:tensorflow:Restoring parameters from mrpc_output/model.ckpt-312
INFO:tensorflow:Running local_init_op.
INFO:tensorflow:Done running local_init_op.
INFO:tensorflow:Finished evaluation at 2019-03-03-09:41:04
INFO:tensorflow:Saving dict for global step 312: eval_accuracy = 0.1, eval_loss = 2.3766909, global_step = 312, loss = 2.3766909
INFO:tensorflow:Saving 'checkpoint_path' summary for global step 312: mrpc_output/model.ckpt-312
INFO:tensorflow:evaluation_loop marked as finished
INFO:tensorflow:***** Eval results *****
INFO:tensorflow: eval_accuracy = 0.1
INFO:tensorflow: eval_loss = 2.3766909
INFO:tensorflow: global_step = 312
INFO:tensorflow: loss = 2.3766909
是由于训练步问题吗?

确实是训练步数,调整epoch,立马提升精度!谢谢!

确实是训练步数,调整epoch,立马提升精度!谢谢!

请问你将epoch调整到了多少,我设置num_train_epochs=50,ACC还是0.1,是还需要调整其他参数吗? @zy486at189cn

python run_classifier.py --task_name=MRPC --do_train=true --do_eval=true --data_dir=data/ --vocab_file=uncased_L-12_H-768_A-12/vocab.txt --bert_config_file=uncased_L-12_H-768_A-12/bert_config.json --init_checkpoint=uncased_L-12_H-768_A-12/bert_model.ckpt --train_batch_size=32 --learning_rate=2e-5 --num_train_epochs=100.0 --output_dir=mrpc_output/

和楼上一样的参数,但acc仍然为0.1