Sneha_Verma:

i am training the data but the training loss does not go below 80. can you please tell me what i am doing wrong?


You could try to overfit a really small dataset first by playing around with hyperparameters and make sure your model is able to do so.



 Sneha_Verma:

also i am getting issue when i change the hidden layer to 8 or 10 as
[…]
i have used torch.cuda.empty_cache()


torch.cuda.empty_cache() won’t help in this case besides slowing down your code.
Your GPU doesn’t have enough memory for 10 layers, so you could either lower the batch size or use torch.utils.checkpoint to trade compute for memory.