You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I use the weight file you provided, and modify only the 100th line of the crnn_recognizer.py file to def init(self, model_path='checkpoints/CRNN.pth'). When I execute ' python demo.py' command is an error, the display is as follows
Traceback (most recent call last):
File "demo.py", line 2, in
from ocr import ocr
File "/media/hgh/HGH_30/plate/ocr.pytorch-master/ocr.py", line 6, in
recognizer = PytorchOcr()
File "/media/hgh/HGH_30/plate/ocr.pytorch-master/recognize/crnn_recognizer.py", line 111, in init
self.model.load_state_dict(torch.load(model_path))
File "/mnt/home/hgh/anaconda2/envs/py3_torch4.1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for CRNN_v2:
Missing key(s) in state_dict: "conv1_1.weight", "conv1_1.bias", "bn1_1.weight", "bn1_1.bias", "bn1_1.running_mean", "bn1_1.running_var", "conv1_2.weight", "conv1_2.bias", "bn1_2.weight", "bn1_2.bias", "bn1_2.running_mean", "bn1_2.running_var", "conv2_1.weight", "conv2_1.bias", "bn2_1.weight", "bn2_1.bias", "bn2_1.running_mean", "bn2_1.running_var", "conv2_2.weight", "conv2_2.bias", "bn2_2.weight", "bn2_2.bias", "bn2_2.running_mean", "bn2_2.running_var", "conv3_1.weight", "conv3_1.bias", "bn3_1.weight", "bn3_1.bias", "bn3_1.running_mean", "bn3_1.running_var", "conv3_2.weight", "conv3_2.bias", "bn3_2.weight", "bn3_2.bias", "bn3_2.running_mean", "bn3_2.running_var", "conv4_1.weight", "conv4_1.bias", "bn4_1.weight", "bn4_1.bias", "bn4_1.running_mean", "bn4_1.running_var", "conv4_2.weight", "conv4_2.bias", "bn4_2.weight", "bn4_2.bias", "bn4_2.running_mean", "bn4_2.running_var", "bn5.weight", "bn5.bias", "bn5.running_mean", "bn5.running_var".
Unexpected key(s) in state_dict: "cnn.conv0.weight", "cnn.conv0.bias", "cnn.conv1.weight", "cnn.conv1.bias", "cnn.conv2.weight", "cnn.conv2.bias", "cnn.batchnorm2.weight", "cnn.batchnorm2.bias", "cnn.batchnorm2.running_mean", "cnn.batchnorm2.running_var", "cnn.batchnorm2.num_batches_tracked", "cnn.conv3.weight", "cnn.conv3.bias", "cnn.conv4.weight", "cnn.conv4.bias", "cnn.batchnorm4.weight", "cnn.batchnorm4.bias", "cnn.batchnorm4.running_mean", "cnn.batchnorm4.running_var", "cnn.batchnorm4.num_batches_tracked", "cnn.conv5.weight", "cnn.conv5.bias", "cnn.conv6.weight", "cnn.conv6.bias", "cnn.batchnorm6.weight", "cnn.batchnorm6.bias", "cnn.batchnorm6.running_mean", "cnn.batchnorm6.running_var", "cnn.batchnorm6.num_batches_tracked".
size mismatch for rnn.1.embedding.weight: copying a param of torch.Size([5835, 512]) from checkpoint, where the shape is torch.Size([5997, 512]) in current model.
size mismatch for rnn.1.embedding.bias: copying a param of torch.Size([5835]) from checkpoint, where the shape is torch.Size([5997]) in current model.
Does the weight file you provide correspond to the network? Thanks!
The text was updated successfully, but these errors were encountered:
Hi, I use the weight file you provided, and modify only the 100th line of the crnn_recognizer.py file to def init(self, model_path='checkpoints/CRNN.pth'). When I execute ' python demo.py' command is an error, the display is as follows
Traceback (most recent call last):
File "demo.py", line 2, in
from ocr import ocr
File "/media/hgh/HGH_30/plate/ocr.pytorch-master/ocr.py", line 6, in
recognizer = PytorchOcr()
File "/media/hgh/HGH_30/plate/ocr.pytorch-master/recognize/crnn_recognizer.py", line 111, in init
self.model.load_state_dict(torch.load(model_path))
File "/mnt/home/hgh/anaconda2/envs/py3_torch4.1/lib/python3.6/site-packages/torch/nn/modules/module.py", line 719, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for CRNN_v2:
Missing key(s) in state_dict: "conv1_1.weight", "conv1_1.bias", "bn1_1.weight", "bn1_1.bias", "bn1_1.running_mean", "bn1_1.running_var", "conv1_2.weight", "conv1_2.bias", "bn1_2.weight", "bn1_2.bias", "bn1_2.running_mean", "bn1_2.running_var", "conv2_1.weight", "conv2_1.bias", "bn2_1.weight", "bn2_1.bias", "bn2_1.running_mean", "bn2_1.running_var", "conv2_2.weight", "conv2_2.bias", "bn2_2.weight", "bn2_2.bias", "bn2_2.running_mean", "bn2_2.running_var", "conv3_1.weight", "conv3_1.bias", "bn3_1.weight", "bn3_1.bias", "bn3_1.running_mean", "bn3_1.running_var", "conv3_2.weight", "conv3_2.bias", "bn3_2.weight", "bn3_2.bias", "bn3_2.running_mean", "bn3_2.running_var", "conv4_1.weight", "conv4_1.bias", "bn4_1.weight", "bn4_1.bias", "bn4_1.running_mean", "bn4_1.running_var", "conv4_2.weight", "conv4_2.bias", "bn4_2.weight", "bn4_2.bias", "bn4_2.running_mean", "bn4_2.running_var", "bn5.weight", "bn5.bias", "bn5.running_mean", "bn5.running_var".
Unexpected key(s) in state_dict: "cnn.conv0.weight", "cnn.conv0.bias", "cnn.conv1.weight", "cnn.conv1.bias", "cnn.conv2.weight", "cnn.conv2.bias", "cnn.batchnorm2.weight", "cnn.batchnorm2.bias", "cnn.batchnorm2.running_mean", "cnn.batchnorm2.running_var", "cnn.batchnorm2.num_batches_tracked", "cnn.conv3.weight", "cnn.conv3.bias", "cnn.conv4.weight", "cnn.conv4.bias", "cnn.batchnorm4.weight", "cnn.batchnorm4.bias", "cnn.batchnorm4.running_mean", "cnn.batchnorm4.running_var", "cnn.batchnorm4.num_batches_tracked", "cnn.conv5.weight", "cnn.conv5.bias", "cnn.conv6.weight", "cnn.conv6.bias", "cnn.batchnorm6.weight", "cnn.batchnorm6.bias", "cnn.batchnorm6.running_mean", "cnn.batchnorm6.running_var", "cnn.batchnorm6.num_batches_tracked".
size mismatch for rnn.1.embedding.weight: copying a param of torch.Size([5835, 512]) from checkpoint, where the shape is torch.Size([5997, 512]) in current model.
size mismatch for rnn.1.embedding.bias: copying a param of torch.Size([5835]) from checkpoint, where the shape is torch.Size([5997]) in current model.
Does the weight file you provide correspond to the network? Thanks!
The text was updated successfully, but these errors were encountered: