TypeError: lstm() received an invalid combination of arguments

I apologize in advance that this question appears a lot; however, I could not find an answer to my question in the forums, so I am asking this question anew. Rather than include blocks of code, I have uploaded the project to GitHub. Basically, I am pretty sure that I am creating–and calling the forward function on–an LSTM cell correctly, as I am following the documentation, but obviously I am doing something wrong. One thing to note is that I am doing this as part of an online course provided by Udacity, and the code works perfectly fine on their cloud machine, so it is something to do with the code on my machine.

machine specs:

  • Ubuntu 20.04
  • Python 3.6
  • Built on conda using
    – conda install pytorch torchvision cudatoolkit=10.2 -c pytorch

Please let me know if there is any more info that I need to provide to help with this. I’d love to figure why this code is not running on my local machine.

Please provide all the relevant code here. Try to print the input/hidden shapes that you are passing to the lstm when the error occurs so it’s easier for us to find a solution.

All the relevant code is included in the Jupyter Notebook, which I link to (it’s the GitHub link)