@oxyd33 - did you progress with your error? I’m also still getting a TypeError: ‘DataFrame’ objects are mutable, thus they cannot be hashed
, despite being on the newest version (1.0.36)
EDIT:
It seems that I have simply not realized that the function signature of TabularDataBunch.from_df
silently changed after 1.0.22 — also the get_tabular_learner method was renamed. Now on the latest version and after adjusting my code, I’m getting this error when trying to fit:
data_bunch = TabularDataBunch.from_df('data/', full_df, dep_var, valid_idx, tfms=[FillMissing, Categorify],
cat_names=cat_vars, cont_names=contin_vars)
learn = tabular_learner(data_bunch, layers=[200,100,50], emb_szs={'provider': 3}, metrics=accuracy)
learn.fit(15, 2e-3)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-24-a5c1880537cc> in <module>
----> 1 learn.fit(15, 2e-3)
/anaconda3/lib/python3.6/site-packages/fastai/basic_train.py in fit(self, epochs, lr, wd, callbacks)
164 callbacks = [cb(self) for cb in self.callback_fns] + listify(callbacks)
165 fit(epochs, self.model, self.loss_func, opt=self.opt, data=self.data, metrics=self.metrics,
--> 166 callbacks=self.callbacks+callbacks)
167
168 def create_opt(self, lr:Floats, wd:Floats=0.)->None:
/anaconda3/lib/python3.6/site-packages/fastai/basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics)
92 except Exception as e:
93 exception = e
---> 94 raise e
95 finally: cb_handler.on_train_end(exception)
96
/anaconda3/lib/python3.6/site-packages/fastai/basic_train.py in fit(epochs, model, loss_func, opt, data, callbacks, metrics)
80 cb_handler.on_epoch_begin()
81
---> 82 for xb,yb in progress_bar(data.train_dl, parent=pbar):
83 xb, yb = cb_handler.on_batch_begin(xb, yb)
84 loss = loss_batch(model, xb, yb, loss_func, opt, cb_handler)
/anaconda3/lib/python3.6/site-packages/fastprogress/fastprogress.py in __iter__(self)
63 self.update(0)
64 try:
---> 65 for i,o in enumerate(self._gen):
66 yield o
67 if self.auto_update: self.update(i+1)
/anaconda3/lib/python3.6/site-packages/fastai/basic_data.py in __iter__(self)
70 for b in self.dl:
71 y = b[1][0] if is_listy(b[1]) else b[1]
---> 72 yield self.proc_batch(b)
73
74 @classmethod
/anaconda3/lib/python3.6/site-packages/fastai/basic_data.py in proc_batch(self, b)
63 "Proces batch `b` of `TensorImage`."
64 b = to_device(b, self.device)
---> 65 for f in listify(self.tfms): b = f(b)
66 return b
67
TypeError: __init__() missing 1 required positional argument: 'cont_names'
While I really appreciate the dedication to make a great product and API interface, changes with magnitudes like these, especially within minor releases after a v1 actually surprise me. It’s hard to put much trust into the platform.
EDIT2: Changing tfms
to procs
finally did the trick. Looks like it’s finally working.