C4W4 LSTM produces constant forecast

I’ve cloned the specialization repository and I’m trying to run locally the notebook called “C4_W4_Lab_1_LSTM.ipynb” (Coursera | Online Courses & Credentials From Top Educators. Join for Free | Coursera).

Everything seems to be working just fine up to the “Model Prediction” section - the forecast produced by the model is almost constant, with values raging from 1.34 to 1.36. I’ve encountered the issue of constant forecast also when using different dataset and various combinations of hyperparameters.

Has anyone experienced this or can suggest a solution?

I’m not using GPU, I’m on Ubuntu, with Python 3.9.18 and tensorflow 2.7.0.

You’ll need to install all of the same versions of all of the packages that Coursera Labs provides.