When I trying to use ctcloss:
ctc = torch.nn.CTCLoss()
ctc(logits,targets,input_lengths,target_lengths)
I got error log:
RuntimeError: Expected tensor to have size 70816 at dimension 0, but got size 2213 for argument #2 ‘targets’ (while checking arguments for ctc_loss_gpu)
And the shape of my four argument are:
torch.Size([1629, 32, 47]) torch.Size([2213])
torch.Size([32]) torch.Size([32])
I think i have catenated the targets, why I met with this problem?