TypeError: relu(): argument 'input' (position 1) must be Tensor, not tuple. I believe it's because I have an LSTM layer. How can I modify the code so it will work fine? Any help?

Please ensure you are putting a PyTorch tensor inside relu and not a python tuple or any other data structure.

Hi I’m not sure how can I do that? When I remove LSTM layer and add a linear layer, it works fine. But I need to keep LSTM layer. So how can I correct it?

Can you please post a minimum executable snippet?

Hi @sam5,

What’s the shape of x_training? Could that be the Tuple you’re looking for?

Also, can you share the code within three backticks (```)? Posting screenshots isn’t legible.

It’s solved. Thank you.