PanXiebit / convlstm_nslt

0 stars 0 forks source link

CTC loss #1

Open faresbs opened 4 years ago

faresbs commented 4 years ago

Hi,

i am working on the same RWTH-PHOENIX-Weather 2014 dataset. Did you succeed in training the lstm-CTC under TensorFlow ctc loss. My model seems to predict only blanks after a few batches. And the loss is slowly decreasing even after many epochs. I am getting a loss of around 4 and as a result, i am getting a very high WER score.

I was wondering whether you got the same thing?

Thank you.

PanXiebit commented 4 years ago

Hi Faris,

I am sorry for responding you in time, because we are on vocation recently.

I meet the same situation that training the lstm-ctc with tensorflow ctc_loss api. The same like you, the loss cannot reduce, and maintained at 4~5. And than I rerite the coe with pytorch, the loss start to reduce, after 20 epochs, the loss can be about 0.4, but the metric WER was still at a high level(0.97).

I'm also confused about this, there may be problems with the decoded code(CTCBeamDeocde), and I am trying to find the reason and solve it.

I'm glad to hear from you, and hope to communicate with you more about RWTH-PHOENIX-Weather 2014 dataset.

Best wishes, Pan Xie

2020-01-17 3:10 GMT+08:00, Faris Ben Sliman notifications@github.com:

Hi,

i am working on the same RWTH-PHOENIX-Weather 2014 dataset. Did you succeed in training the lstm-CTC under TensorFlow ctc loss. My model seems to predict only blanks after a few batches. And the loss is slowly decreasing even after many epochs. I am getting a loss of around 4 and as a result, i am getting a very high WER score.

I was wondering whether you got the same thing?

Thank you.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/PanXiebit/convlstm_nslt/issues/1

faresbs commented 4 years ago

Hi Pan Xie,

It seems that I've fixed the problem. it was related to how Pytorch uses its CTC loss layer. Concerning your situation, i think you are right. if you are getting low loss value and high WER that means that you are probably doing something wrong in the decoding process. Check if you are using the correct blank label. I personally found that decoding using Tensorflow beam search implementation worked much better than CTCBeamDeocde. Maybe you can try that instead?

Please let me know with the results.

Farris

Le lun. 20 janv. 2020 à 01:48, PanXiebit notifications@github.com a écrit :

Hi Faris,

I am sorry for responding you in time, because we are on vocation recently.

I meet the same situation that training the lstm-ctc with tensorflow ctc_loss api. The same like you, the loss cannot reduce, and maintained at 4~5. And than I rerite the coe with pytorch, the loss start to reduce, after 20 epochs, the loss can be about 0.4, but the metric WER was still at a high level(0.97).

I'm also confused about this, there may be problems with the decoded code(CTCBeamDeocde), and I am trying to find the reason and solve it.

I'm glad to hear from you, and hope to communicate with you more about RWTH-PHOENIX-Weather 2014 dataset.

Best wishes, Pan Xie

2020-01-17 3:10 GMT+08:00, Faris Ben Sliman notifications@github.com:

Hi,

i am working on the same RWTH-PHOENIX-Weather 2014 dataset. Did you succeed in training the lstm-CTC under TensorFlow ctc loss. My model seems to predict only blanks after a few batches. And the loss is slowly decreasing even after many epochs. I am getting a loss of around 4 and as a result, i am getting a very high WER score.

I was wondering whether you got the same thing?

Thank you.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/PanXiebit/convlstm_nslt/issues/1

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PanXiebit/convlstm_nslt/issues/1?email_source=notifications&email_token=AEM4KTEFJXYLU5F3USIE2LDQ6VCLVA5CNFSM4KHZGCE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJLQ6XA#issuecomment-576130908, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEM4KTBEXHWWBHIFLXMCXALQ6VCLVANCNFSM4KHZGCEQ .

PanXiebit commented 4 years ago

Hi faresbs

You probably know that China is experiencing a severe 2019-nConv epidemic. So I can't go back to school, it is not convenient to do the experiments.

You are right that the CTCDecode is wrong, and I reimplement the greedySearch by myself, and then it seems works. But the experiment result doesn't meet expectations. My model is pretrained-resnet18 + bidirecional-RNN(hidden-size=256) + greedySearch. The best wer in development dataset is only about 0.72.

How was your experiment?

Pan

faresbs commented 4 years ago

Hi Pan, My thoughts and prayers are with you and your country. Yes, i am having a decent wer score in the dev set that are close to those of the paper. Maybe try increasing your model capacity.

PanXiebit commented 4 years ago

Hi faresbs,

Thanks for your reply. I only used one 1080ti(11G) when doing the experiment, so the model capacity cannot be set larger. If it is convenient, could you tell some more details about your experiments setting?

  1. did you use pytorch or tensorflow?
  2. what about your ctc_loss and ctcdecoder api?
  3. how about your model structure, model parameters and optimizer parameters?

Looking forward to hearing from you.

Pan

faresbs commented 4 years ago

Hey, 1- Pytorch 2- i used the ctc_loss of pytorch (i had problems with it at first but i fixed it (see https://discuss.pytorch.org/t/ctcloss-predicts-blanks/66928/2)) and i used TensorFlow CTC beam decoder (I know it is a dirty hack but it seems to work, i am planning to change it in the future maybe we can cooperate on that).

  1. Adam for optimization and i used 2 layers similar to the original paper