unexpected key module.encoder.embedding.weight state_dict DataParallel 报错处理

这个报错就是权重文件是用 DataParallel 多卡训练保存的,所有参数名字前面自动带上了 module 前缀,但是你现在加载的时候用的是原生