I don’t think the blank_ind (in this case 249) appears in the targets within the target_lengths.  I did a check via something like:
            for i in range(inputs['image'].shape[0]):
                length = outputs['label_length'][i]
                if length > 1 and blank_ind in outputs['the_labels'][i][:length]:
                    print(outputs['the_labels'][i])
                    print(outputs['the_labels'][i][:length])
                    print(outputs['label_length'][i])
                    raise Exception

in the__getitem__ method, and it never fired.  Just so that I’m clear on the behavior of target_lengths, for an item like:
tensor([  0,  76,  81,  98,   1, 249, 249, 249, 249, 249, 249, 249])

with a target length of 5, that should give:
tensor([ 0, 76, 81, 98,  1])

as the actual target within the CTCLoss code?
I tried setting the blank_ind for the CTCLoss to something else that’s never in the targets (like 230), and it started predicting that after a while.  I did some tests earlier that set the blank_ind to 0 (and added 1 to all existing labels to offset them), and it did the same behavior of predicting the blank index.  I did some tests earlier removing the data items without any labels to see if that affected it, as well as using the CPU version, but the same behavior shows up.