dawn2034
dawn2034
我也遇到同样的坑,找到了如下解决办法,worker 和 ps 建立通信,亲测有效: https://zjj2wry.github.io/tensorflow/dist/
Missing key(s) in state_dict: "embeddings.word_embeddings.weight", "embeddings.position_embeddings.weight", "embeddings.token_type_embeddings.weight", "embeddings.LayerNorm.gamma", "embeddings.LayerNorm.beta",...... Unexpected key(s) in state_dict: "bert.embeddings.word_embeddings.weight", "bert.embeddings.position_embeddings.weight", "bert.embeddings.token_type_embeddings.weight", "bert.embeddings.LayerNorm.weight", "bert.embeddings.LayerNorm.bias"...... 就是当前模型和state_dict字典key名字不同,可参考以下代码更改key值 ```python state_dict = torch.load(pretrained_model_file, map_location='cpu') old_keys = [] new_keys = []...