AttributeError: 'BertConfig' object has no attribute 'output_attentions'
I am trying to run lcf_bert. While running infer_example_bert_models.py I am facing following issue:
Traceback (most recent call last):
File "infer_example_bert_models.py", line 80, in <module>
model = opt.model_class(bert, opt).to(opt.device)
File "/Users/lucky/parabole/code/absa/ABSA-PyTorch/models/lcf_bert.py", line 41, in __init__
self.bert_SA = SelfAttention(bert.config, opt)
File "/Users/lucky/parabole/code/absa/ABSA-PyTorch/models/lcf_bert.py", line 23, in __init__
self.SA = BertSelfAttention(config)
File "/Users/lucky/parabole/code/absa/env/lib/python3.7/site-packages/pytorch_transformers/modeling_bert.py", line 268, in __init__
self.output_attentions = config.output_attentions
AttributeError: 'BertConfig' object has no attribute 'output_attentions'
The modules installed in my virtual environment are:
boto3==1.10.46
botocore==1.13.46
certifi==2019.11.28
chardet==3.0.4
Click==7.0
docutils==0.15.2
idna==2.8
jmespath==0.9.4
joblib==0.14.1
numpy==1.18.0
python-dateutil==2.8.1
pytorch-pretrained-bert==0.6.2
pytorch-transformers==1.2.0
regex==2019.12.20
requests==2.22.0
s3transfer==0.2.1
sacremoses==0.0.38
scikit-learn==0.22.1
scipy==1.4.1
sentencepiece==0.1.85
six==1.13.0
sklearn==0.0
torch==1.2.0
tqdm==4.41.1
urllib3==1.25.7
I have seen the modelling_bert. py in "/Users/lucky/parabole/code/absa/env/lib/python3.7/site-packages/pytorch_transformers/modeling_bert.py", it is actually having
self.output_attentions = config.output_attentions
But I am not gettting what is causing this error and how to solve it?
The latest PR (#112) may solve your problem. @luckysunda
The latest PR (#112) may solve your problem. @luckysunda
Yes, it has solved the issue, thank you so much.
Hi, it doesn't have files or solutions, could you tell me how can I use the link?