chahuja / language2pose

Language2Pose: Natural Language Grounded Pose Forecasting

Home Page:http://chahuja.com/language2pose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BERT] AttributeError: 'NoneType' object has no attribute 'embeddings'

ailingzengzzz opened this issue · comments

When I use "bert" model in nlp/bert.py, the error says the BertModel has not been found.

Model name 'bert-base-uncased' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncas
ed, bert-base-multilingual-cased, bert-base-chinese). We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased.tar.gz' was a path or url but couldn't find any file associated to this path or url.

File "language2pose/src/model/model.py", line 246, in init
self.sentence_enc = BertForSequenceEmbedding(self.hidden_size)
File "language2pose/src/nlp/bert.py", line 27, in init
toggle_grad(self.bert.embeddings, False)
AttributeError: 'NoneType' object has no attribute 'embeddings'

I have solved it by downloading the pretrained model manually and replaced the loading code. For more information, please check https://www.cnblogs.com/lian1995/p/11947522.html for details.