ebanalyse / NERDA

Framework for fine-tuning pretrained transformers for Named-Entity Recognition (NER) tasks
MIT License
155 stars 35 forks source link

'BertModel' object has no attribute 'name_or_path' #5

Closed cyrusdobbs closed 3 years ago

cyrusdobbs commented 3 years ago

Hi there - thanks for releasing your code and taking the time to read my issue!

I've just started to explore how NERDA works by trying to run the code from https://ebanalyse.github.io/NERDA/workflow/ but ran into the error of:

KeyError: 'electra'

I then changed the transformer to 'bert-base-multilingual-uncased' but now I am getting the error of:

ModuleAttributeError: 'BertModel' object has no attribute 'name_or_path'

I can't see anyone else with the same issue online and my knowledge of transformers is poor. I'd really appreciate any help you could provide.

Cheers

cyrusdobbs commented 3 years ago

Ah fixed it. My issue was some dependencies were outdated. I created a new virtualenv and started again.

yazidhadni commented 3 years ago

Hi, I have the same problem. Can you tell me how did you fix it please? Thanks in advance :)

cyrusdobbs commented 3 years ago

Hi, I have the same problem. Can you tell me how did you fix it please? Thanks in advance :)

Hi, It was an issue with the versions of the libraries that NERDA uses. I'd recommend creating a fresh virtualenv for that particular project and reimporting NERDA and it's dependencies.

yazidhadni commented 3 years ago

I did, however the error is still here :( You installed NERDA version 0.8.8 ?