Get_emb_szs() error

When creating a tabular learner from a databunch, I get this error. If I try to declare emb_szs manually, I still get the error. Is this a bug?

<ipython-input-13-00bbb564f593> in <module>
----> 1 learn = tabular_learner(data, layers=[200,100], metrics=accuracy)

~/.local/lib/python3.6/site-packages/fastai/tabular/data.py in tabular_learner(data, layers, emb_szs, metrics, ps, emb_drop, y_range, use_bn, **learn_kwargs)
    172         ps:Collection[float]=None, emb_drop:float=0., y_range:OptRange=None, use_bn:bool=True, **learn_kwargs):
    173     "Get a `Learner` using `data`, with `metrics`, including a `TabularModel` created using the remaining params."
--> 174     emb_szs = data.get_emb_szs(ifnone(emb_szs, {}))
    175     model = TabularModel(emb_szs, len(data.cont_names), out_sz=data.c, layers=layers, ps=ps, emb_drop=emb_drop,
    176                          y_range=y_range, use_bn=use_bn)

~/.local/lib/python3.6/site-packages/fastai/data_block.py in _inner(*args, **kwargs)
    470         assert isinstance(fv, Callable)
    471         def _inner(*args, **kwargs):
--> 472             self.train = ft(*args, from_item_lists=True, **kwargs)
    473             assert isinstance(self.train, LabelList)
    474             kwargs['label_cls'] = self.train.y.__class__

TypeError: get_emb_szs() got an unexpected keyword argument 'from_item_lists```

How are you creating your databunch?

Like so:

cat_names = ['cell', 'year', 'month', 'day', 'hour', 'minute', 'flag']
cont_names = ['VA','VB','VC','Tin','Tout','Pin','Pout','Current','WDT','PSenb','CellFlt','WDTrip','rate', 'coilcount']
procs = [FillMissing, Categorify, Normalize]
valid_idx = range(int(len(df)/2), len(df))
data = (TabularDataBunch.from_df('./fast-ai-model/',df,'flag',valid_idx=valid_idx,cat_names=cat_names,cont_names=cont_names,procs=procs)
        .split_subsets(0.5,0.5)
        .label_from_df(cols='flag'))

Try instead using TabularList and the datablock API like from lesson 4. As you’re creating a databunch and then trying to apply itemlist options to a databunch when it’s already made.

Thanks! Yeah, I was trying to move towards using databunches, but it didn’t go very well obviously. I think I’ll stick with the TabularList method for now.