yijiuzai / chinese-ocr

6 stars 10 forks source link

维度不匹配 #2

Open leizeling opened 6 years ago

leizeling commented 6 years ago

运行时出现如下错误,请问有什么解决办法吗? Traceback (most recent call last): File "/home/ustc/Desktop/chinese-ocr-master/demo.py", line 2, in import model File "/home/ustc/Desktop/chinese-ocr-master/model.py", line 6, in from crnn.crnn import crnnOcr File "/home/ustc/Desktop/chinese-ocr-master/crnn/crnn.py", line 47, in model,converter = crnnSource() File "/home/ustc/Desktop/chinese-ocr-master/crnn/crnn.py", line 43, in crnnSource model.load_state_dict(torch.load(path)) File "/home/ustc/anaconda3/envs/chinese_ocr_master/lib/python3.5/site-packages/torch/nn/modules/module.py", line 721, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for CRNN: While copying the parameter named "rnn.1.embedding.weight", whose dimensions in the model are torch.Size([5531, 512]) and whose dimensions in the checkpoint are torch.Size([5530, 512]). While copying the parameter named "rnn.1.embedding.bias", whose dimensions in the model are torch.Size([5531]) and whose dimensions in the checkpoint are torch.Size([5530]).

RayJueZhu commented 4 years ago

可以提供下之前的vgg的模型吗,或者是怎么训练的阿?