Thank you for the answer @RaLo4 ! As you have said, the problem is the inconsistency between the shapes of “hidden” and “labels”. Actually, I have just explained my problem here better: Problem with converting my LSTM multi-label classification model to a binary classification model
I have been trying to migrate my multi-class classification model to a binary classification model. In the former case, I was using “CrossEntropyLoss” and “Linear” Activation and there was no problem. As you can see now, problem arises when I alter them to “BCELoss” and “Sigmoid” Activation. Maybe instead of reshaping the output, I have to change the forward method of LSTM class from scratch, since it was written for a multi-class classification model?