Nlp.ipynb: " 'CosAnneal' object has no attribute 'on_phase_begin' " Error

I’m trying to run the nlp.ipynb notebook, but I ran into trouble, when executing the command:, 1, wds=1e-5, cycle_len=1)
I found out that I wasn’t the only one with such a problem:
Other post about similar problem
but as I suspected that it might be an error related to the fact that my fastai scripts weren’t up to date anymore, I cloned again the repo and tried to execute again the notebook. The same command produced an error but a different one:

    119     if not isinstance(data, Iterable): data = [data]
120     if len(data) == 1: data = data * len(n_epochs)
--> 121     for cb in callbacks: cb.on_phase_begin()
122     model_stepper = stepper(model, opt.opt if hasattr(opt,'opt') else opt, crit, **kwargs)
123     ep_vals = collections.OrderedDict()

AttributeError: 'CosAnneal' object has no attribute 'on_phase_begin'

If someone knows more than me about the source of this problem, please help me out!


The NLP.ipynb notebook uses as seen in:
from fastai.nlp import *

This has now been abandoned by fastai in favor of as seen in:
from fastai.text import *

look at imdb.ipynb in course dl2 instead

rename the file as

1 Like

Thank you very much for your answer @sam2.

I looked at the imdb.ipynb of the dl2 course, but I didn’t find what was contained the the nlp.ipynb notebook of the dl1 course. Also I don’t really understand what this imdb.ipynb notebook is supposed to be. It looks to me as if it redoes what was done in the lesson4-imdb.ipynb of the dl1 course. I guess this should be the topic of another post, but could you maybe tell me if there is a place on this forum where someone explains how the general course evolves? I thought that dl2 would be about more advanced tricks, but it looks to be (at least when I look at this imdb.ipynb notebook) more like an upgraded version of the dl1.
Is there a place where one can have a general description of the course, what is updated, what should be forgotten, etc…?

Thanks a lot!

I wish there was a nice compendium available like that.
You may get some clues by going thru the recorded lessons here:

I think the course material will undergo further changes when it as adapted to pytorch 0.4. At the beginning of this course (i.e. dl2) there was some talk about Jeremy looking forward to release of pytorch 0.4 and hence the release of material was pushed to June 2018 (I think), but as things stand it is still with pytorch 0.3.1 as in the git requirements

You may reach out to rachel thomas.

1 Like

Thanks for your reply sam2!

I will keep an eye on the progress of fastai, and occasionally post questions on this forum when I don’t get something.

Have a great day!