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
I added more character('train.py' --character) and got an error (size mismatch)
I don't know why It works when the Prediction is different from what pretrained model's Prediction
for example these code is work
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, 1637]).
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([1381, 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([1381]).
and How to fix this error
'demo.py'
confidence_score = pred_max_prob.cumprod(dim=0)[-1]
IndexError: index -1 is out of bounds for dimension 0 with size 0
The text was updated successfully, but these errors were encountered:
I added more character('train.py' --character) and got an error (size mismatch)
I don't know why It works when the Prediction is different from what pretrained model's Prediction
for example these code is work
python train.py --train_data data_lmdb/training --workers 0 --valid_data data_lmdb/validation --Transformation TPS --FeatureExtraction ResNet --SequenceModeling BiLSTM --Prediction CTC --saved_model pretrained_models/TPS-ResNet-BiLSTM-Attn.pth --FT
python train.py --train_data data_lmdb/training --workers 0 --valid_data data_lmdb/validation --Transformation TPS --FeatureExtraction ResNet --SequenceModeling BiLSTM --Prediction Attn --saved_model pretrained_models/TPS-ResNet-BiLSTM-CTC.pth --FT
but If Prediction is the same as pretrained_model has
python train_test.py --train_data data_lmdb/training --workers 0 --valid_data data_lmdb/validation --Transformation TPS --FeatureExtraction ResNet --SequenceModeling BiLSTM --Prediction Attn --saved_model pretrained_models/TPS-ResNet-BiLSTM-Attn.pth --FT
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, 1637]).
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([1381, 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([1381]).
and How to fix this error
'demo.py'
confidence_score = pred_max_prob.cumprod(dim=0)[-1]
IndexError: index -1 is out of bounds for dimension 0 with size 0
The text was updated successfully, but these errors were encountered: