Homura:

Change zero infinity to True in the CTCloss (this was when I got negative values but now I only see positive value after some changes in the model so I think this is not the case).


One of the things to watch out for is that CTCLoss expects you to input log probabilities, so you need to use log_softmax on the input argument. Getting negative values may originate from a violation of this constraint. (And after I checked, it looks like you use softmax instead from a cursory look.)
Best regards
Thomas