I was going through lesson5-sgd-mnist.ipynb and noticed that pathlib’s Path does not get imported:
I did not think much of it and did
from fastai.vision import *
And got past the error. However, a little later in the same notebook, I am getting this error:
data = DataBunch.create(train_ds, valid_ds, bs=bs)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-12-16801c71829f> in <module>
1
----> 2 data = DataBunch.create(train_ds, valid_ds, bs=bs)
~/git/fastai/fastai/basic_data.py in create(cls, train_ds, valid_ds, test_ds, path, bs, num_workers, tfms, device, collate_fn, no_check)
112 collate_fn:Callable=data_collate, no_check:bool=False)->'DataBunch':
113 "Create a `DataBunch` from `train_ds`, `valid_ds` and maybe `test_ds` with a batch size of `bs`."
--> 114 datasets = cls._init_ds(train_ds, valid_ds, test_ds)
115 val_bs = bs
116 dls = [DataLoader(d, b, shuffle=s, drop_last=(s and b>1), num_workers=num_workers) for d,b,s in
~/git/fastai/fastai/basic_data.py in _init_ds(train_ds, valid_ds, test_ds)
102 @staticmethod
103 def _init_ds(train_ds:Dataset, valid_ds:Dataset, test_ds:Optional[Dataset]=None):
--> 104 fix_ds = valid_ds.new(train_ds.x, train_ds.y) # train_ds, but without training tfms
105 datasets = [train_ds,valid_ds,fix_ds]
106 if test_ds is not None: datasets.append(test_ds)
AttributeError: 'TensorDataset' object has no attribute 'new'
I am on commit ce85b4718865f25d0243042c0e4d051929ca3b52 and not seeing anything obvious.
Does this ring a bell to anybody?