CogQA icon indicating copy to clipboard operation
CogQA copied to clipboard

model1 = BertForMultiHopQuestionAnswering.from_pretrained(BERT_MODEL, cache_dir=PYTORCH_PRETRAINED_BERT_CACHE / 'distributed_{}'.format(-1))

Open ShaoaAllen opened this issue 4 years ago • 2 comments

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-uncased, 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.

作者老师您好! Model name 'bert-base-uncased' was not found in model name list (bert-base-uncased, 这个是我今年见过的最离谱的bug了。。。

ShaoaAllen avatar Jan 13 '21 11:01 ShaoaAllen

I'm sorry but I have no idea about the bug with such a strange log. Could you check the network, version and path (or something like them) again?

Sleepychord avatar Jan 13 '21 13:01 Sleepychord

自己来回答下吧!这个问题算是有些眉目了!初步推测问题出在from pytorch_pretrained_bert.modeling import ( BertPreTrainedModel as PreTrainedBertModel, # The name was changed in the new versions of pytorch_pretrained_bert这句代码上,我尝试把as PreTrainedBertModel删了,然后BertForMultiHopQuestionAnswering(BertPreTrainedModel)再改下。 我猜测是BertPreTrainedModel这个类名字变化引起model1没有加载到

ShaoaAllen avatar Jan 15 '21 08:01 ShaoaAllen