Turns out the problem is due to the amount of parameters I am initializing the lstm model with. When I reduce the amount of parameters in layers 2 and 3 respectively. e.g by a factor of 80 and 120 from the output of the previous layers respectively, the maximum recursion depth error vanishes.
I wouldn’t think 18000 parameters in an LSTM model should overwhelm the python stack given that most users would want deep models with such numbers. Perhaps something the pytorch devs might want to look into.