Fastai v2 chat

Hi @sgugger. Tried to update to the last version of fastai2 (v 0.0.8) and now receiving an error when using text_classifier_learner:

learn = text_classifier_learner(dbunch_fwd, 
                                AWD_LSTM, 
                                seq_len=72,
                                pretrained=False, 
                                config=config, 
                                metrics=[accuracy], 
                                path=path, 
                                drop_mult=0.7,
                                loss_func=CrossEntropyLossFlat()
                               ).to_fp16()

error:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-30-a900cdbe143c> in <module>
      7                                 path=path,
      8                                 drop_mult=0.7,
----> 9                                 loss_func=CrossEntropyLossFlat()
     10                                ).to_fp16()
     11 

/media/hdd3tb/data/fastai2/fastai2/text/learner.py in text_classifier_learner(dls, arch, seq_len, config, pretrained, drop_mult, n_out, lin_ftrs, ps, max_len, **kwargs)
    173                                 drop_mult=drop_mult, lin_ftrs=lin_ftrs, ps=ps, max_len=max_len)
    174     meta = _model_meta[arch]
--> 175     learn = TextLearner(dls, model, splitter=meta['split_clas'], **kwargs)
    176     if pretrained:
    177         if 'url' not in meta:

/media/hdd3tb/data/fastai2/fastai2/text/learner.py in __init__(self, model, dls, loss_func, alpha, beta, moms, **kwargs)
     51     def __init__(self, model, dls, loss_func, alpha=2., beta=1., moms=(0.8,0.7,0.8), **kwargs):
     52         super().__init__(model, dls, loss_func, moms=moms, **kwargs)
---> 53         self.add_cbs([ModelReseter(), RNNTrainer(alpha=alpha, beta=beta)])
     54 
     55     def save_encoder(self, file):

NameError: name 'RNNTrainer' is not defined

Change of name wasnā€™t properly saved in the notebook, should be fixed now.

1 Like

Thanks!

How can I use nbdev to jump through the library? I tried doing:

from nbdev.showdoc import *
nb_source_link(Pipeline)

But I get the error:

AssertionError: Use `Config.create` to create a `Config` object the first time

I tried calling nbdev_build_lib inside my fastai clone but that did not helped

@lgvaz see here: (and the following discussion mentioned)

1 Like

By the way, for those navigating the documentation and may have issues with the search being confusing, you can jump to the right page by first seeing what notebook itā€™s in:

DataBlock??

Which will give us fastai2/data/block.py
We can take this and put it directly into the URL like so:

dev.fast.ai/data.block.html

1 Like

From _resnet_split, I think the issue is with m[1:] as I have the same issue if I do:

learn = unet_learner(dls, models.resnet34, pretrained=False)
learn.model[1:].parameters

The other sections of the model (m[0][:6] and m[0][6:]) can return parameters.

Let me know if anybody can confirm there is a bug and I can file an issue in the repo if necessary.

If I had to guess, does it work if you pass pretrained=True?

With pretrained=True the model does not load at all.
With pretrained=False it works but the same error happens later when we do learn.fit(1)

With something like this, Iā€™d put in an issue (since they are working on the book) so they know to get to it :slight_smile: (as i canā€™t see where that would go wrong). Are you using the most recent git version?

1 Like

Yes, Iā€™m using the most recent git version and just tried to run the entire notebook 21.
Iā€™ll just file an issue. I was just scared that I did something wrong as I thought all notebooks were run through CI before being merged.

1 Like

Dear Jeremy,
I hope you are ok.
I would like to attend the new course on March 2020.
How can I access it?

You can apply to join the course in SF here: https://www.usfca.edu/data-institute/certificates/deep-learning-part-one

(For online live streaming, you need an inviteā€“theyā€™ve already gone out, based on forum participation.)

Jeremy, what was the requirement for getting the invite this time?

Based on an opaque metric, related to forum participation :wink:

Hi,
Will they be posted online?
Thanks for this outstanding course

Theyā€™ll be posted online once itā€™s released to the public. (Possibly in June-ish with how the previous courses have been)

Iā€™m trying out the Lesson 6: rosemann notebook example and iā€™m getting this error when i run

tst_preds,_ = learn.get_preds(dl=test_dbunch.train_dl)

i get

AttributeError: train_dl

Has any encounter same ?

Itā€™s jsut train and not train_dl now. The course has not necessarily been updated everywhere.

@sgugger, many thanks !