我试图使用自定义数据进一步预训练bert基础模型。我下面的步骤如下:
从自定义数据生成单词列表,并将这些单词添加到现有的bert base vocab文件中。vocab大小已从35022
增加到35880
我使用来自the bert official github page的create_pretraining_data.py创建了输入数据
使用运行\u pretraining.py执行预训练,但遇到不匹配错误:
ValueError: Shape of variable bert/embeddings/word_embeddings:0 ((35880, 128)) doesn't match with shape of tensor bert/embeddings/word_embeddings ([30522, 128]) from checkpoint reader.
注意:我将bert_config
文件更改为vocab_size
文件
请帮助我了解错误以及应该做哪些更改,以便我可以使用自定义vocab文件进行预训练
目前没有回答
相关问题 更多 >
编程相关推荐