kamalkraj / BERT-NER-TF

Named Entity Recognition with BERT using TensorFlow 2.0
Apache License 2.0
212 stars 71 forks source link

UnboundLocalError: local variable 'eval_features' referenced before assignment #25

Open deepakbandela opened 2 years ago

deepakbandela commented 2 years ago

Following through the readme and ran the file python run_ner.py --data_dir=data/ --bert_model=bert-base-cased --output_dir=out_base --max_seq_length=128 --do_train --num_train_epochs 3 --do_eval --eval_on dev

I get this error. This is blocking,

Traceback (most recent call last): File "C:\work\code\ai\BERT-NER-TF\run_ner.py", line 512, in main() File "C:\work\code\ai\BERT-NER-TF\run_ner.py", line 380, in main np.asarray([f.label_id for f in eval_features],dtype=np.int32)) UnboundLocalError: local variable 'eval_features' referenced before assignment

MengAaron commented 8 months ago

You can put the code of definition of eval_features above the line 380