meijieru / crnn.pytorch

Convolutional recurrent network in pytorch
MIT License
2.4k stars 657 forks source link

Is it normal for the model to predict the same string for the whole train batch and val? #243

Closed SalmaG98 closed 3 years ago

SalmaG98 commented 3 years ago

Hello @meijieru and collaborators! Thank you for your work!

I'm trying to train a model with a different lmdb dataset that is bucketized, for this I only changed the code in dataset.py for the dataset reading since it contains a few additional keys, utils.py, train.py are the same as yours except I commented pred.squeeze(2) in train.py since I'm using a recent pytorch version, I wanted to ask you and everyone who has tried to work with this code if anyone has experienced having the same predictions for the whole training batch and the subsequent validation batch.

At first I thought the loss was maybe behaving weirdly because of some wrong input I was giving the cost() method but then I debugged the script and it showed that the preds and targets were properly encoded and in the right shape for cost() so I'm unable to find where the problem lies, does anyone have any idea about this?

Thanks :)