chahuja / language2pose

Language2Pose: Natural Language Grounded Pose Forecasting
http://chahuja.com/language2pose
MIT License
64 stars 14 forks source link

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

Closed ailingzengzzz closed 4 years ago

ailingzengzzz commented 4 years ago

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.