yeyupiaoling / MASR

Pytorch实现的流式与非流式的自动语音识别框架,同时兼容在线和离线识别,目前支持Conformer、Squeezeformer、DeepSpeech2模型,支持多种数据增强方法。
Apache License 2.0
563 stars 100 forks source link

预训练模型加载错误 #27

Closed Crescentz closed 2 years ago

Crescentz commented 2 years ago
self.__class__.__name__, "\n\t".join(error_msgs)))

RuntimeError: Error(s) in loading state_dict for DeepSpeech2Model: size mismatch for output.weight: copying a param with shape torch.Size([2988, 1024]) from checkpoint, the shape in current model is torch.Size([3894, 1024]). size mismatch for output.bias: copying a param with shape torch.Size([2988]) from checkpoint, the shape in current model is torch.Size([3894]).

Crescentz commented 2 years ago

RuntimeError: Error(s) in loading state_dict for DeepSpeech2Model: size mismatch for output.weight: copying a param with shape torch.Size([3894, 1024]) from checkpoint, the shape in current model is torch.Size([6436, 1024]). size mismatch for output.bias: copying a param with shape torch.Size([3894]) from checkpoint, the shape in current model is torch.Size([6436]).

yeyupiaoling commented 2 years ago

如果是使用预训练模型用于训练,这事这正常的,因为字典不一样,所最后一层的输出大小也不一样。这不是错误。

Crescentz commented 2 years ago

如果是使用预训练模型用于训练,这事这正常的,因为字典不一样,所最后一层的输出大小也不一样。这不是错误。

用的是你压缩包里的model和vocab.txt

1600小时那个是对的

aishell和thus这两个数据就会有错误

yeyupiaoling commented 2 years ago

数据集不一样,字典当然不一样