Just a note that I’ve managed to solve the issue I was having.  Using https://github.com/Holmeyoung/crnn-pytorch 79 as a working version compared to mine, the issue was that when I was porting over the dataset from the Keras implementation, text was in the shape of (N_batches, max_sequence_length).  Any texts shorter than max_sequence_length (in my case 12), were padded with blank labels.  In contrast, the working version in pytorch has text as a 1-dimensional tensor that’s the summed lengths of all texts in the batches.
Hope this helps anyone having a similar error.