Last answered:

20 Nov 2025

Posted on:

19 Nov 2025

0

Model Hanging on the Fit Method

Hey Team,

I need your help working through my model hanging on the .fit() method. Both my code and the code from the provided notebook, TensorFlow MNIST Part 6 with Comments, are hanging. I'm at 10 minutes on the .fit() method without moving past the first epoch. Again, this happens with the code provided in the course notebook listed above, so I did not type anything incorrectly.

thanks for your help and I'd really appreciate an answer on this one as I'm not convinced AI is going to help me solve this one. Thanks!

Python version: 3.11.13
tensorflow version: 2.19.1

Jupyter Version Info:
IPython          : 9.5.0
ipykernel        : 6.30.1
ipywidgets       : not installed
jupyter_client   : 8.6.3
jupyter_core     : 5.8.1
jupyter_server   : 2.16.0
jupyterlab       : 4.4.7
nbclient         : 0.10.2
nbconvert        : 7.16.6
nbformat         : 5.10.4
notebook         : 7.4.5
qtconsole        : not installed
traitlets        : 5.14.3
1 answers ( 0 marked as helpful)
Posted on:

20 Nov 2025

0
Okay, so after hours of effort, I determined the answer. But this was not an enjoyable process. I recommend updating the tensorflow instructions at the begining of the course to reflect what I'm about to explain to save others this same issue.

For anyone running tensorflow on a Mac OS, you must install tensorflow-macos and NOT tensorflow, which is what the course says to do. Once i finally determined the issue was not anything to do with my MNIST dataset or the code related to it, but rather the install of tensorflow itself, which is directly related to a Mac OS vs. a Windows, the solution was easy.

But finally arriving at that conclusion took a pile of troubleshooting and hours of time. So again, please update the course instructions for those of us running tensorflow on Mac OS rather than Windows.

I've read a bunch of info about also needing to install tensorflow-metal to have the operations run on the GPU, but I did not need that step to solve the problem of the fit() method hanging indefinitely. Simply creating a new virtual environment and installing tensorflow-macos fixed that.

thanks!

-Justin

Submit an answer