运行时出现如下错误,请问有什么解决办法吗?
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]).
运行时出现如下错误,请问有什么解决办法吗? 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]).