taokz / BiomedGPT

BiomedGPT: A Unified and Generalist Biomedical Generative Pre-trained Transformer for Vision, Language, and Multimodal Tasks
Apache License 2.0
364 stars 34 forks source link

'InverseSquareRootSchedule' object has no attribute 'reinit' #11

Closed nghiemkythu closed 6 months ago

nghiemkythu commented 6 months ago

Hello, When I run the code for pre-training, I have an error: AttributeError: 'InverseSquareRootSchedule' object has no attribute 'reinit' I do not change the code, I just create dataset files with the same format as you said. How can I solve this problem.

taokz commented 6 months ago

Could you provide full error log for me?

nghiemkythu commented 6 months ago

This is the file log after I run the code.

pretrain_tiny.log

nghiemkythu commented 6 months ago

I am so sorry, I have changed the lr scheduler to inverse_sqrt in file pretrain_tiny.sh. However, when I change this setting to polynomial_decay and add --total-num-update into this file (If I do not add this term, it will notify error because of missing it), it still notify the error "'PolynomialDecayLRSchedule' object has no attribute 'reinit'". This is the file log after I run the code. pretrain_tiny.log The version of fairseq that I use is fairseq==0.12.2 (latest version)

taokz commented 6 months ago

Could you check:

  1. if pip==21.2.4
  2. uninstall the fairseq, and install it via pip -e ./fairseq/ in the directory of BiomedGPT
nghiemkythu commented 6 months ago

Thank you very much for your instruction. I have fixed this bug by git clone the latest version of fairseq and add the function reinit from your fairseq folder to this folder (because when I use your folder, there are some bug related to version conflict).