Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databunch API seems to be broken. #3

Closed
at110 opened this issue Feb 17, 2019 · 3 comments
Closed

databunch API seems to be broken. #3

at110 opened this issue Feb 17, 2019 · 3 comments

Comments

@at110
Copy link

at110 commented Feb 17, 2019

Hi Renato,

I updated my fastai repository and looking like it broke fastai_scans.
for

data = (fastai_scans.SegmentationItemList.from_paths(train_data_bolz, train_labels_bolz)
                                         .random_split_by_pct(0.2, seed=7)
                                         .label_from_bcolz()
                                         .transform(fastai_scans.get_transforms(), tfm_y=True)
                                         .databunch(bs=bs)
                                         .normalize())

I am getting

TypeError Traceback (most recent call last)
in
3 .label_from_bcolz()
4 .transform(fastai_scans.get_transforms(), tfm_y=True)
----> 5 .databunch(bs=bs)
6 .normalize())

~/fastai-fork/fastai/data_block.py in databunch(self, path, bs, val_bs, num_workers, dl_tfms, device, collate_fn, no_check, **kwargs)
494 path = Path(ifnone(path, self.path))
495 data = self.x._bunch.create(self.train, self.valid, test_ds=self.test, path=path, bs=bs, val_bs=val_bs,
--> 496 num_workers=num_workers, device=device, collate_fn=collate_fn, no_check=no_check, **kwargs)
497 if getattr(self, 'normalize', False):#In case a normalization was serialized
498 norm = self.normalize

~/tutorials/fastai_scans/fastai_scans/data.py in create(cls, train_ds, valid_ds, **kwargs)
25 @classmethod
26 def create(cls, train_ds, valid_ds, **kwargs):
---> 27 return super().create(train_ds, valid_ds, **kwargs)
28
29 def normalize(self, format3d=True, do_x=True, do_y=False):

TypeError: create() got multiple values for keyword argument 'num_workers'

@at110
Copy link
Author

at110 commented Feb 17, 2019

it was simple change...

class BcolzDataBunch(DataBunch):
    @classmethod
    def create(cls, train_ds, valid_ds, **kwargs):
        return super().create(train_ds, valid_ds,  num_workers=0, **kwargs)

to

class BcolzDataBunch(DataBunch):
    @classmethod
    def create(cls, train_ds, valid_ds, **kwargs):
        return super().create(train_ds, valid_ds,  **kwargs)

Solved issue

@renato145
Copy link
Owner

It should be working now :)

@at110
Copy link
Author

at110 commented Feb 17, 2019

Thanks @renato145

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants