I have model_output of size [T, N, C] and target of size [N,T]. I won’t have targets of variable length. Is this how I declare the lengths?
op_len = torch.full((N,), T, dtype=torch.long) 
target_len = torch.randint(1,T,(N,), dtype=torch.long)
train_loss = ctc_loss(model_output, target, op_len, target_len)

I am asking as the train loss is infinity after first iteration. There is no problem with the model. This happens only with CTCLoss( ). Any idea why?