yzhangcs / parser

:rocket: State-of-the-art parsers for natural language.
https://parser.yzhang.site/
MIT License
827 stars 139 forks source link

Missing lr_rate and warmup #79

Closed rootofmylife closed 3 years ago

rootofmylife commented 3 years ago

Hi,

I have used your new release code, but when I trained the model, there are some errors related to configurations.

To reproduce, I used this command line to train a model on Google Colab.

!python -u -m supar.cmds.biaffine_dep train -b -d 0 -c biaffine-dep-en \
  -p model \
  --train /content/predict/train.conllx  \
  --dev /content/predict/dev.conllx  \
  --test /content/predict/test.conllx  \
  --encoder=bert  \
  --bert=vinai/phobert-base  \
  --unk unk \
  --punct

I also tried with this command line (lr_rate and warmup are included):

!python -u -m supar.cmds.biaffine_dep train -b -d 0 -c biaffine-dep-en \
  -p model \
  --train /content/predict/train.conllx  \
  --dev /content/predict/dev.conllx  \
  --test /content/predict/test.conllx  \
  --encoder=bert  \
  --bert=vinai/phobert-base  \
  --lr-rate=20 \
  --warmup=200 \
  --unk unk \
  --punct

But the errors about missing lr_rate and warm_up still occur.

To solve above problems, I have to create a new config.ini file and include 2 above params and it works.

I guess that maybe we need some default params to ignore these problems. Thanks!

Sorry, I don't have any screenshot or capture errors to this issue, because I have a model training now. But I will update it later.

yzhangcs commented 3 years ago

@rootofmylife

I guess that maybe we need some default params to ignore these problems. Thanks!

This is indeed the cause of the crash. If training with BERT, I recommend the config biaffine-dep-roberta-en. lr and warm_up in this file are 5e-5 and 0.1, which are empirically better for fine-tuning.

rootofmylife commented 3 years ago

Yeah, I see. Thanks