Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: pretrained bert file does not exist #52

Open
gravity5212 opened this issue Sep 24, 2023 · 1 comment
Open

AssertionError: pretrained bert file does not exist #52

gravity5212 opened this issue Sep 24, 2023 · 1 comment

Comments

@gravity5212
Copy link

C:\Users\yinli\miniconda3\envs\bbcn\python.exe D:\实体\pytorch_bert_bilstm_crf_ner-main\main.py
{0: 'O', 1: 'B-dep', 2: 'I-dep', 3: 'E-dep', 4: 'S-dep', 5: 'B-dru', 6: 'I-dru', 7: 'E-dru', 8: 'S-dru', 9: 'B-equ', 10: 'I-equ', 11: 'E-equ', 12: 'S-equ', 13: 'B-bod', 14: 'I-bod', 15: 'E-bod', 16: 'S-bod', 17: 'B-ite', 18: 'I-ite', 19: 'E-ite', 20: 'S-ite', 21: 'B-mic', 22: 'I-mic', 23: 'E-mic', 24: 'S-mic', 25: 'B-pro', 26: 'I-pro', 27: 'E-pro', 28: 'S-pro', 29: 'B-sym', 30: 'I-sym', 31: 'E-sym', 32: 'S-sym', 33: 'B-dis', 34: 'I-dis', 35: 'E-dis', 36: 'S-dis'}
Namespace(adam_epsilon=1e-08, bert_dir='../model_hub/bert-base-chinese/', crf_lr=0.03, data_dir='./data/CHIP2020', data_name='chip', dropout=0.3, dropout_prob=0.1, eval_batch_size=12, gpu_ids='0', log_dir='./logs/', lr=3e-05, lstm_hidden=128, max_grad_norm=1, max_seq_len=150, model_name='bert_bilstm_crf', num_layers=1, num_tags=37, other_lr=0.0003, output_dir='./checkpoints/', seed=123, swa_start=3, train_batch_size=32, train_epochs=3, use_crf='True', use_idcnn='False', use_kd='False', use_lstm='True', use_tensorboard='True', warmup_proportion=0.1, weight_decay=0.01)
Traceback (most recent call last):
File "D:\实体\pytorch_bert_bilstm_crf_ner-main\main.py", line 327, in
bertForNer = BertForNer(args, train_loader, dev_loader, dev_loader, id2query)
File "D:\实体\pytorch_bert_bilstm_crf_ner-main\main.py", line 36, in init
model = bert_ner_model.BertNerModel(args)
File "D:\实体\pytorch_bert_bilstm_crf_ner-main\bert_ner_model.py", line 201, in init
super(BertNerModel, self).init(bert_dir=args.bert_dir, dropout_prob=args.dropout_prob, model_name=args.model_name)
File "D:\实体\pytorch_bert_bilstm_crf_ner-main\bert_base_model.py", line 11, in init
assert os.path.exists(bert_dir) and os.path.exists(config_path),
AssertionError: pretrained bert file does not exist

Process finished with exit code 1
萌新提问,还麻烦大佬解答

@taishan1994
Copy link
Owner

预训练模型是否已经下载好了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants