Open 2017ZYS opened 3 years ago
Same question ! Look forward to your reply...
Q: Should the loss calculated by warp-ctc be the sum of pyorch's loss(reduction is "none")? A: yes You should set revise your code "input_lengths = torch.full(size=(N,), fill_value=T, dtype=torch.long)" with "input_lengths = torch.full(size=(N,), fill_value=T, dtype=torch.int32)"
My test environment is as follows: ######################################################## torch==1.4.0 torchvision==0.5.0 cuda==9.0/10.1 ########################################################
My test code is as follows: ########################################################
########################################################
The printed result is
######################################################## Q: Should the loss calculated by warp-ctc be the sum of pyorch's loss(reduction is "none")? I find that 278.4382+289.9979+276.8926+278.0664+272.8851 is not equal to 828.2159,however 278.4382+276.8926+272.8851 is equal to 828.2159. It maybe means only the even indexed data is used to calculate the loss by warp_ctc, no loss is calculated for odd indexed data. Is it a bug?