deep-text-recognition-benchmark icon indicating copy to clipboard operation
deep-text-recognition-benchmark copied to clipboard

Special character fine tune with pre trained model

Open aafaqin opened this issue 3 years ago • 5 comments

Shape mismatch is happening if I try to add extra 2 characters. Any solution for the same? If i want to do fine tuning on TPS-ResNet-BiLSTM-Attn.pth

RuntimeError: Error(s) in loading state_dict for DataParallel: size mismatch for module.Prediction.attention_cell.rnn.weight_ih: copying a param with shape torch.Size([1024, 294]) from checkpoint, the shape in current model is torch.Size([1024, 296]). size mismatch for module.Prediction.generator.weight: copying a param with shape torch.Size([38, 256]) from checkpoint, the shape in current model is torch.Size([40, 256]). size mismatch for module.Prediction.generator.bias: copying a param with shape torch.Size([38]) from checkpoint, the shape in current model is torch.Size([40]).

aafaqin avatar Jun 02 '22 13:06 aafaqin

The only thing that worked for me is to train from scratch

gitdeepheolp avatar Jun 05 '22 21:06 gitdeepheolp

I'm also interested in adding a few special characters but I cannot use TPS-ResNet-BiLSTM-Attn-case-sensitive.pth. Has anyone been able to solve this?

rafaelagrc avatar Jun 21 '22 10:06 rafaelagrc

I also get the same error when I want to do a test. Is there a solution for this error?

ftmasadi avatar Dec 11 '22 11:12 ftmasadi

I'm also interested in adding a few special characters but I cannot use TPS-ResNet-BiLSTM-Attn-case-sensitive.pth. Has anyone been able to solve this?

are you find any solution?

ftmasadi avatar Dec 11 '22 11:12 ftmasadi

Shape mismatch is happening if I try to add extra 2 characters. Any solution for the same? If i want to do fine tuning on TPS-ResNet-BiLSTM-Attn.pth

RuntimeError: Error(s) in loading state_dict for DataParallel: size mismatch for module.Prediction.attention_cell.rnn.weight_ih: copying a param with shape torch.Size([1024, 294]) from checkpoint, the shape in current model is torch.Size([1024, 296]). size mismatch for module.Prediction.generator.weight: copying a param with shape torch.Size([38, 256]) from checkpoint, the shape in current model is torch.Size([40, 256]). size mismatch for module.Prediction.generator.bias: copying a param with shape torch.Size([38]) from checkpoint, the shape in current model is torch.Size([40]).

Please help me if you find a solution for this issue?

ftmasadi avatar Dec 11 '22 11:12 ftmasadi