Notes on the use of CTCloss that comes with pytorch

When it comes to speech projects or CRNN's LSTM training, CTCLoss is usually used. When using a lower version of pytorch, one uses Baidu CTCloss. Since the 3090 card was changed, pytorch was also forced to upgrade to version 1.8. There is no way to be compatible with Baidu CTC, switch back to the built-in from torch.nn import CTCLoss,

It was found that the training did not predict the content for a long time. It turns out that the difference from Baidu CTC is that the input of CTCloss that comes with pytorch needs to go through log_softmax. During training, the output layer of the network is added with

net(image).log_softmax()

problem solved.

 

Guess you like

Origin blog.csdn.net/qq_36276587/article/details/117416054