Problems in using the new library


I found this page that contains good ML code and that uses the fastai library.
But I’m having big problems in converting the usage of the library 0.7 to 0.10
The latest one is related to use the command:

This is the error:

AttributeError Traceback (most recent call last)
in ()
----> 1 learner.predict(data)

/usr/local/lib/python3.6/dist-packages/fastai/ in predict(self, img, pbar)
223 “Return prect class, label and probabilities for img.”
224 ds =
–> 225 ds.set_item(img)
226 res = self.pred_batch(ds_type=DatasetType.Single, pbar=pbar)
227 ds.clear_item()

AttributeError: ‘TensorDataset’ object has no attribute ‘set_item’

If I understood correctly, when creating the data and learner:

data = DataBunch(train_dl=train_dl, valid_dl=test_dl, path=path)
learner = Learner(data, model, loss_func=loss_func, metrics=acc_func, wd=0.1)

I should actually create my own dataBunch and implement the set_item. But I cannot find an example in how to do it.

Could you please help me?

Many thanks,
Joao Sauer