I’m not a mentor for AI4M, but looking at your exception trace it’s clear you are running the notebook locally on your own computer. That can cause “versionitis” problems, because the notebooks in the courses here were designed to work with whatever versions of the TF/Keras APIs and other packages that were current at the time the assignment was initially published. Unfortunately things evolve pretty rapidly in this space, so you can’t guarantee that the notebooks will work with whatever the more recent versions are that you have installed on your system.
There are ways to duplicate version environments using tools like Anaconda, but this is not a simple matter and we do not have any official documentation about how to do it. Here’s a thread which will get you started down that road.
The other alternative is that you just have to debug each such problem as you encounter it.
Of course the simplest alternative is just to work only on the Coursera website with the course assignments. Also note that it’s not a safe thing to work on the notebooks in a different environment and then upload them back to the Coursera site. Some external tools modify the JSON “metadata” in the notebooks in ways that may not be compatible with the Coursera graders. In particular, we have seen concrete cases in which Google Colab rewrites our notebooks in incompatible ways, although of course that’s not the case you have here. Just a warning in general.