Regarding errors in downloaded notebooks from Machine Learning Specialization

I’ve completed the Machine learning specialization & have downloaded the notebooks for my reference. I do not have access to notebooks as course time is completed. The issue is when I am trying to run the downloaded notebooks for a refresher, I am constantly getting the following errors: what should I do to be able to run the notebooks without coming across the following errors:

deeplearning.mplstyle’ is not a valid package style, path of style file, URL of style file, or library style name (library styles are listed in style.available)

No module named ‘sklearn’

No module named ‘utils’

There are a couple of levels to the answer here. At the high level, the point is that just the notebook file (ipynb file) by itself is not sufficient to be able to run the notebook: each one is accompanied by a whole tree of supporting files. For example that typically includes additional python files containing support routines. That’s probably the cause of your error about the module “utils” being missing. That was probably a file called utils.py that needs to be in the same directory as the notebook. Here’s a thread about how to download all the files instead of just the notebook itself, but if you no longer have access to the course that will only be useful for future courses you take.

Then the next level is that you’ll need to install a lot of packages like sklearn in whatever environment you choose to use for executing the notebooks. There are no official instructions on how to do that because there are just too many possible environments and we can’t cover everything. But here’s a thread that will at least get you started down that long and winding road.

Note that one other environment you can use which will already supply all the packages is Google Colab, but that requires some changes to the notebooks, as described on this thread. But then you can run into “versionitis” problems with the various packages, since the notebooks use whatever versions were current at the time they were released.

1 Like