Notebook code results in "not defined" errors in multiple places

OK, I started the course and successfully trained the “first_training” code so I know that things are functioning. However, I ran into a “widgets not defined” error at the “upload your own image” (uploader defined) code (see my response at Name 'widgets' is not defined & taking lot of time to run the fastbook ch-1 on colab), and seemed to have fixed it.

I then ran the following two code fragments and got “not defined” errors and reread the chapter, noticing two code fragments above “Your Deep Learning Journey”, which I ran. That cleared up the original “not defined” errors, but now I get the following error:

NameError: name ‘learn’ is not defined

Is there an import that must be added?

NOTE: I have the book, kindle version.

Are you running the notebooks from here? I would run the notebook cells in order. You can also restart the notebook and rerun the cells if needed.

No, I ran it from paperspace’s notebook. I tried to perform all code again and got the same error as noted above.

OK, for whatever reason, it finally worked! Not sure why it took a few tries through the chapter’s code but it did.

1 Like