walkwithfastai / walkwithfastai.github.io

Host for https://walkwithfastai.com
Other
143 stars 53 forks source link

tab_ae.ipynb; could not do one pass in your dataloader #63

Open lzumot opened 1 year ago

lzumot commented 1 year ago

where: 03_tab.ae.ipynb,

cell/command: to = TabularPandasIdentity(df, [Categorify, FillMissing, Normalize], cat_names, cont_names, splits=RandomSplitter(seed=32)(df)) dls = to.dataloaders(bs=1024)

error: = .iLoc requires numeric indexers, got [None]

cannot do _one_pass

lzumot commented 1 year ago

potential fix in notebook but not sure it breaks anything, comment out do_item = noops to allow it to run when called for one_pass:

@delegates() class TabDataLoaderIdentity(TabDataLoader): "A transformed DataLoader for AutoEncoder problems with Tabular data"

do_item = noops <------------------ comment out

def __init__(self, dataset, bs=16, shuffle=False, after_batch=None, num_workers=0, **kwargs):
    if after_batch is None: after_batch = L(TransformBlock().batch_tfms)+ReadTabBatchIdentity(dataset)
    super().__init__(dataset, bs=bs, shuffle=shuffle, after_batch=after_batch, num_workers=num_workers, **kwargs)

def create_batch(self, b): return self.dataset.iloc[b]