我正在尝试在Google Cloud ML上运行Hugging Face BERT,但无法加载模型
这是我的Python代码:
self.bert_model = "bert-large-uncased"
self.tokenizer = BertTokenizer.from_pretrained(self.bert_model, do_lower_case=True)
,它失败了。
INFO 2019-03-13 16:49:51 -0400 master-replica-0 1 https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-uncased-vocab.txt not found in cache, downloading to /tmp/tmpuhva1fm1
INFO 2019-03-13 16:49:51 -0400 master-replica-0 1 copying /tmp/tmpuhva1fm1 to cache at /root/.pytorch_pretrained_bert/9b3c03a36e83b13d5ba95ac965c9f9074a99e14340c523ab405703179e79fc46.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084
INFO 2019-03-13 16:49:51 -0400 master-replica-0 1 creating metadata file for /root/.pytorch_pretrained_bert/9b3c03a36e83b13d5ba95ac965c9f9074a99e14340c523ab405703179e79fc46.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084
INFO 2019-03-13 16:49:51 -0400 master-replica-0 1 removing temp file /tmp/tmpuhva1fm1
INFO 2019-03-13 16:49:51 -0400 master-replica-0 1 loading vocabulary file https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-uncased-vocab.txt from cache at /root/.pytorch_pretrained_bert/9b3c03a36e83b13d5ba95ac965c9f9074a99e14340c523ab405703179e79fc46.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084
INFO 2019-03-13 16:49:52 -0400 master-replica-0 1 https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-uncased.tar.gz not found in cache, downloading to /tmp/tmp80ev4u7r
ERROR 2019-03-13 16:49:52 -0400 master-replica-0 1 Model name 'bert-large-uncased' was not found in model name list (bert-base-chinese, bert-base-multilingual-cased, bert-large-uncased, bert-large-cased, bert-base-cased, bert-base-multilingual-uncased, bert-base-uncased). We assumed 'https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-uncased.tar.gz' was a path or url but couldn't find any file associated to this path or url.
请注意,它抱怨“在模型名称列表中未找到'bert-large-uncased'”和“我们假设'https://s3.amazonaws.com/models.huggingface.co/bert/bert-large-uncased.tar.gz'是路径或url,但找不到与此相关的任何文件路径或网址”。但是,两个值都是正确的。
是否有人成功在Google ml-engine中运行HF BERT?