Fastai v2 chat

I’m having trouble creating a test set where the get_x and get_y methods aren’t the same as for the training/validation data. I read x and y from a dataframe for the training/validation data, but the test set must be read from a folder.

I’ve tried creating a test databunch from scratch from a DataBlock:

def get_xpath(x): return x
colnames = df.columns #these are the category labels
test_dblk = DataBlock(blocks=(ImageBlock, MultiCategoryBlock()),
                     get_items = get_image_files,
                     get_x = get_xpath,
                     splitter=RandomSplitter(valid_pct=1))

item_tfms = Resize(512)
batch_tfms = [*aug_transforms(size=224), Normalize()]

testbunch = ImageDataBunch.from_dblock(test_dblk,'testpath', test='test')

It works but I get a warning that it doesn’t know what c is, so I add a vocabulary and set c:

testbunch.vocab = CategoryMap(colnames,sort=False)
testbunch.c = c

All seems good but then throws an error when I try to grab one item using ```

testbunch.valid_ds[0][0]` --> Error: 'PosixPath' object is not iterable

The error is coming from transforms, but it somehow relates to the vocab:

.../fastai2/fastai2/data/transforms.py in encodes(self, o)
    201             self.vocab = CategoryMap(list(vals), add_na=self.add_na)
    202 
--> 203     def encodes(self, o): return TensorMultiCategory([self.vocab.o2i[o_] for o_ in o])
    204     def decodes(self, o): return MultiCategory      ([self.vocab    [o_] for o_ in o])

I tried making everything into lists, but then get other errors. I also tried calling test_dl with the main databunch I use for train/valid data, but that also failed.

testfiles = get_image_files(testpath)
mytestdl = test_dl(main_dbunch,testfiles) 

In fastai v1, you could add a test set to a DataBunch with data.add_data() but that option has disappeared.

(I’m trying not to ask too many questions, but I’m so stuck!)

If you have different get_x/get_y methods for your test set, the data block API is not going to work for you, you need to dig in the middle-level API. Define your own TfmdList/Datasource for your dataset, then create your test_dl with

test_dl = dbunch.valid_dl.new(dataset=my_datasource_or_tmfd_list)

Ah, that explains it! Thanks very much for that clue, Sylvain.

Hello, friends!

I’m fiddling around with fastai2 and it seems that 03_data.core isn’t passing the tests:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-37-023481880db5> in <module>
      1 items = L([1.,2.,3.]); tfms = [neg_tfm, int2f_tfm]
----> 2 tl = TfmdList(items, tfms=tfms)
      3 test_eq_type(tl[0], TitledInt(-1))
      4 test_eq_type(tl[1], TitledInt(-2))
      5 test_eq_type(tl.decode(tl[2]), TitledFloat(3.))

/opt/anaconda3/lib/python3.7/site-packages/fastcore/foundation.py in __call__(cls, x, *args, **kwargs)
     39             return x
     40 
---> 41         res = super().__call__(*((x,) + args), **kwargs)
     42         res._newchk = 0
     43         return res

<ipython-input-32-15dcc14be248> in __init__(self, items, tfms, use_list, do_setup, as_item, split_idx, train_setup, splits, types)
     11         self.tfms = Pipeline(tfms, as_item=as_item, split_idx=split_idx)
     12         self.types = types
---> 13         if do_setup: self.setup(train_setup=train_setup)
     14 
     15     def _new(self, items, **kwargs): return super()._new(items, tfms=self.tfms, do_setup=False, types=self.types, **kwargs)

<ipython-input-32-15dcc14be248> in setup(self, train_setup)
     24 
     25     def setup(self, train_setup=True):
---> 26         self.tfms.setup(self, train_setup)
     27         if len(self) != 0:
     28             x,self.types = super().__getitem__(0),[]

TypeError: setup() takes from 1 to 2 positional arguments but 3 were given

Can you reproduce this or is it just something on my environment?

Thanks!

1 Like

Hey @mrdbarros! I made an issue on GitHub and @sgugger recommended:

I think you have a conflict between latest fastcore and not latest fastai2. This should be fixed now (please reopen if it is not).

How are you setting up the environment? And what versions do you have for fastai2 and fastcore? I have not had a chance to test out this solution yet today :slight_smile:

Hey @muellerzr. Thanks for the quick response.

I set up the fastai2 environment as a editable install. It is up-to-date with the repo. Fastcore were downloaded as a dependency I believe…

dataclasses               0.6                        py_0    fastai
fastai                    1.0.59                        1    fastai
fastai2                   0.0.4                     dev_0    <develop>
fastcache                 1.1.0            py37h7b6447c_0
fastcore                  0.1.6                    pypi_0    pypi
fastprogress              0.2.1                    pypi_0    pypi
fastscript                0.1.2                    pypi_0    pypi
nvidia-ml-py3             7.352.0                    py_0    fastai
regex                     2018.01.10      py37h14c3975_1000    fastai
spacy                     2.0.18          py37hf484d3e_1000    fastai
thinc                     6.12.1          py37h637b7d7_1000    fastai 

I’ve just tried to make an editable install for fastcore too, which upgraded its version:

jupyter@fastai-sp-1:~/mrdbarros/fastcore$ conda list | grep fast
    dataclasses               0.6                        py_0    fastai
    fastai                    1.0.59                        1    fastai
    fastai2                   0.0.4                     dev_0    <develop>
    fastcache                 1.1.0            py37h7b6447c_0
    fastcore                  0.1.10                    dev_0    <develop>
    fastprogress              0.2.1                    pypi_0    pypi
    fastscript                0.1.2                    pypi_0    pypi
    nvidia-ml-py3             7.352.0                    py_0    fastai
    regex                     2018.01.10      py37h14c3975_1000    fastai
    spacy                     2.0.18          py37hf484d3e_1000    fastai
    thinc                     6.12.1          py37h637b7d7_1000    fastai

I’m still getting the same error. :thinking:

You can do this again, I added a bit that lets us customize the input types each transform can receive at inference.

1 Like

@mrdbarros looks like @sgugger fixed the issue last night :slight_smile: Thanks!!!

  • on predict: awesome! Thank you :slight_smile:

@muellerzr, solution confirmed! Just had to fetch fastcore and fastai2 to get today’s release.

Thanks again.

1 Like

One big change in API to note in the text area: the tokenizing step can now be done as a Transform so it takes less lines of codes to create a model. I have updated all tutorials, examples and the course lesson 3 to reflect that.

2 Likes

@sgugger, after recent update, on windows I start to get from pets example line

dbunch = get_dbunch(224, bs, ‘zeros’)

error:


TypeError Traceback (most recent call last)
in
----> 1 dbunch = get_dbunch(224, bs, ‘zeros’)

in get_dbunch(size, bs, pad_mode, batch)
1 def get_dbunch(size, bs, pad_mode=‘reflection’, batch=False):
2 return pets.databunch(path/‘images’, path=path, item_tfms=Resize(460), bs=bs,
----> 3 batch_tfms=[*tfms(size=size, pad_mode=pad_mode, batch=batch), Normalize.from_stats(*imagenet_stats)])

d:\codes\fastai_dev\fastai2\fastai2\data\block.py in databunch(self, source, path, type_tfms, item_tfms, batch_tfms, **kwargs)
80
81 def databunch(self, source, path=’.’, type_tfms=None, item_tfms=None, batch_tfms=None, **kwargs):
—> 82 dsrc = self.datasource(source, type_tfms=type_tfms)
83 item_tfms = _merge_tfms(self.default_item_tfms, item_tfms)
84 batch_tfms = _merge_tfms(self.default_batch_tfms, batch_tfms)

d:\codes\fastai_dev\fastai2\fastai2\data\block.py in datasource(self, source, type_tfms)
77 type_tfms = L([self.default_type_tfms, type_tfms, labellers]).map_zip(
78 lambda tt,tfm,l: L(l) + _merge_tfms(tt, tfm))
—> 79 return DataSource(items, tfms=type_tfms, splits=splits, dl_type=self.dl_type, n_inp=self.n_inp)
80
81 def databunch(self, source, path=’.’, type_tfms=None, item_tfms=None, batch_tfms=None, **kwargs):

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in init(self, items, tfms, tls, n_inp, dl_type, **kwargs)
231 def init(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
232 super().init(dl_type=dl_type)
–> 233 self.tls = L(tls if tls else [TfmdList(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
234 self.n_inp = (1 if len(self.tls)==1 else len(self.tls)-1) if n_inp is None else n_inp
235

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in (.0)
231 def init(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
232 super().init(dl_type=dl_type)
–> 233 self.tls = L(tls if tls else [TfmdList(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
234 self.n_inp = (1 if len(self.tls)==1 else len(self.tls)-1) if n_inp is None else n_inp
235

D:\conda3\lib\site-packages\fastcore\foundation.py in call(cls, x, args, **kwargs)
39 return x
40
—> 41 res = super().call(
((x,) + args), **kwargs)
42 res._newchk = 0
43 return res

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in init(self, items, tfms, use_list, do_setup, as_item, split_idx, train_setup, splits, types)
173 self.tfms = Pipeline(tfms, as_item=as_item, split_idx=split_idx)
174 self.types = types
–> 175 if do_setup: self.setup(train_setup=train_setup)
176
177 def _new(self, items, **kwargs): return super()._new(items, tfms=self.tfms, do_setup=False, types=self.types, **kwargs)

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in setup(self, train_setup)
186
187 def setup(self, train_setup=True):
–> 188 self.tfms.setup(self, train_setup)
189 if len(self) != 0:
190 x,self.types = super().getitem(0),[]

TypeError: setup() takes from 1 to 2 positional arguments but 3 were given

Any suggestions?

Are you sure you have the latest master on both fastcore and fastai2? Some changes require you to update both.

the are both up to date… I updated twice yesterday and 3 hrs ago…

Which notebook exactly is failing?

In fact both pets and pets revisited fails. Please, ignore it for a while I want to recheck it again. I know RegexLabeller(r’([^/]+)_\d+.jpg$’) fails on windows and I want to check if it was the cause.

Thank you…

I’m not sure you have the last version. What I have doesn’t have a backslash so should run on Windows normally. And the notebook runs fine on my side.

below is my log of fresh install and still got the same error as above.

D:\codes\fastai_dev\fastai2>pip install -e .[dev]
Obtaining file:///D:/codes/fastai_dev/fastai2
Collecting fastcore
Using cached https://files.pythonhosted.org/packages/cf/78/7fd00b76ee3d35d76ee94ca35b53e432d97fe5654fe76ea67237a417fc53/fastcore-0.1.9-py3-none-any.whl
Requirement already satisfied: torch>=1.2.0 in d:\conda3\lib\site-packages (from fastai2==0.0.4) (1.3.1)
Requirement already satisfied: torchvision in d:\conda3\lib\site-packages (from fastai2==0.0.4) (0.4.2)
Requirement already satisfied: matplotlib in d:\conda3\lib\site-packages (from fastai2==0.0.4) (3.1.2)
Requirement already satisfied: pandas in d:\conda3\lib\site-packages (from fastai2==0.0.4) (0.25.3)
Requirement already satisfied: requests in d:\conda3\lib\site-packages (from fastai2==0.0.4) (2.22.0)
Requirement already satisfied: pyyaml in d:\conda3\lib\site-packages (from fastai2==0.0.4) (5.3)
Collecting fastprogress>=0.1.22
Using cached https://files.pythonhosted.org/packages/41/67/347d73405b8612e436a4278f577186a8b783fe757df549ba1a82a2986727/fastprogress-0.2.2-py3-none-any.whl
Requirement already satisfied: pillow in d:\conda3\lib\site-packages (from fastai2==0.0.4) (6.2.1)
Requirement already satisfied: scikit-learn in d:\conda3\lib\site-packages (from fastai2==0.0.4) (0.22.1)
Requirement already satisfied: scipy in d:\conda3\lib\site-packages (from fastai2==0.0.4) (1.3.2)
Requirement already satisfied: spacy in d:\conda3\lib\site-packages (from fastai2==0.0.4) (2.2.3)
Requirement already satisfied: nbdev in d:\conda3\lib\site-packages (from fastai2==0.0.4) (0.2.3)
Requirement already satisfied: numpy in d:\conda3\lib\site-packages (from fastcore->fastai2==0.0.4) (1.18.1)
Requirement already satisfied: six in d:\conda3\lib\site-packages (from torchvision->fastai2==0.0.4) (1.13.0)
Requirement already satisfied: cycler>=0.10 in d:\conda3\lib\site-packages (from matplotlib->fastai2==0.0.4) (0.10.0)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in d:\conda3\lib\site-packages (from matplotlib->fastai2==0.0.4) (2.4.6)
Requirement already satisfied: kiwisolver>=1.0.1 in d:\conda3\lib\site-packages (from matplotlib->fastai2==0.0.4) (1.1.0)
Requirement already satisfied: python-dateutil>=2.1 in d:\conda3\lib\site-packages (from matplotlib->fastai2==0.0.4) (2.8.1)
Requirement already satisfied: pytz>=2017.2 in d:\conda3\lib\site-packages (from pandas->fastai2==0.0.4) (2019.3)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in d:\conda3\lib\site-packages (from requests->fastai2==0.0.4) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in d:\conda3\lib\site-packages (from requests->fastai2==0.0.4) (1.25.7)
Requirement already satisfied: certifi>=2017.4.17 in d:\conda3\lib\site-packages (from requests->fastai2==0.0.4) (2019.11.28)
Requirement already satisfied: idna<2.9,>=2.5 in d:\conda3\lib\site-packages (from requests->fastai2==0.0.4) (2.8)
Requirement already satisfied: joblib>=0.11 in d:\conda3\lib\site-packages (from scikit-learn->fastai2==0.0.4) (0.14.1)
Requirement already satisfied: cymem<2.1.0,>=2.0.2 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (2.0.3)
Requirement already satisfied: thinc<7.4.0,>=7.3.0 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (7.3.0)
Requirement already satisfied: srsly<1.1.0,>=0.1.0 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (1.0.0)
Requirement already satisfied: plac<1.2.0,>=0.9.6 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (0.9.6)
Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (1.0.0)
Requirement already satisfied: setuptools in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (44.0.0.post20200102)
Requirement already satisfied: wasabi<1.1.0,>=0.4.0 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (0.6.0)
Requirement already satisfied: blis<0.5.0,>=0.4.0 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (0.4.1)
Requirement already satisfied: catalogue<1.1.0,>=0.0.7 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (0.2.0)
Requirement already satisfied: preshed<3.1.0,>=3.0.2 in d:\conda3\lib\site-packages (from spacy->fastai2==0.0.4) (3.0.2)
Requirement already satisfied: nbconvert in d:\conda3\lib\site-packages (from nbdev->fastai2==0.0.4) (5.6.1)
Requirement already satisfied: packaging in d:\conda3\lib\site-packages (from nbdev->fastai2==0.0.4) (20.0)
Collecting fastscript
Using cached https://files.pythonhosted.org/packages/55/0e/ecdc0213646bc82986884121109a38b50bbc2cd2c491bbbfdc7ae39228e3/fastscript-0.1.4-py3-none-any.whl
Requirement already satisfied: nbformat>=4.4.0 in d:\conda3\lib\site-packages (from nbdev->fastai2==0.0.4) (5.0.3)
Requirement already satisfied: tqdm<5.0.0,>=4.10.0 in d:\conda3\lib\site-packages (from thinc<7.4.0,>=7.3.0->spacy->fastai2==0.0.4) (4.41.1)
Requirement already satisfied: importlib-metadata>=0.20; python_version < “3.8” in d:\conda3\lib\site-packages (from catalogue<1.1.0,>=0.0.7->spacy->fastai2==0.0.4) (1.3.0)
Requirement already satisfied: jinja2>=2.4 in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (2.10.3)
Requirement already satisfied: entrypoints>=0.2.2 in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (0.3)
Requirement already satisfied: defusedxml in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (0.6.0)
Requirement already satisfied: bleach in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (3.1.0)
Requirement already satisfied: pygments in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (2.5.2)
Requirement already satisfied: traitlets>=4.2 in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (4.3.3)
Requirement already satisfied: jupyter-core in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (4.6.1)
Requirement already satisfied: testpath in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (0.4.4)
Requirement already satisfied: mistune<2,>=0.8.1 in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (0.8.4)
Requirement already satisfied: pandocfilters>=1.4.1 in d:\conda3\lib\site-packages (from nbconvert->nbdev->fastai2==0.0.4) (1.4.2)
Requirement already satisfied: ipython-genutils in d:\conda3\lib\site-packages (from nbformat>=4.4.0->nbdev->fastai2==0.0.4) (0.2.0)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in d:\conda3\lib\site-packages (from nbformat>=4.4.0->nbdev->fastai2==0.0.4) (3.2.0)
Requirement already satisfied: zipp>=0.5 in d:\conda3\lib\site-packages (from importlib-metadata>=0.20; python_version < “3.8”->catalogue<1.1.0,>=0.0.7->spacy->fastai2==0.0.4) (0.6.0)
Requirement already satisfied: MarkupSafe>=0.23 in d:\conda3\lib\site-packages (from jinja2>=2.4->nbconvert->nbdev->fastai2==0.0.4) (1.1.1)
Requirement already satisfied: webencodings in d:\conda3\lib\site-packages (from bleach->nbconvert->nbdev->fastai2==0.0.4) (0.5.1)
Requirement already satisfied: decorator in d:\conda3\lib\site-packages (from traitlets>=4.2->nbconvert->nbdev->fastai2==0.0.4) (4.4.1)
Requirement already satisfied: pywin32>=1.0; sys_platform == “win32” in d:\conda3\lib\site-packages (from jupyter-core->nbconvert->nbdev->fastai2==0.0.4) (227)
Requirement already satisfied: pyrsistent>=0.14.0 in d:\conda3\lib\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.4.0->nbdev->fastai2==0.0.4) (0.15.6)
Requirement already satisfied: attrs>=17.4.0 in d:\conda3\lib\site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.4.0->nbdev->fastai2==0.0.4) (19.3.0)
Requirement already satisfied: more-itertools in d:\conda3\lib\site-packages (from zipp>=0.5->importlib-metadata>=0.20; python_version < “3.8”->catalogue<1.1.0,>=0.0.7->spacy->fastai2==0.0.4) (8.0.2)
Installing collected packages: fastcore, fastprogress, fastai2, fastscript
Running setup.py develop for fastai2
Successfully installed fastai2 fastcore-0.1.9 fastprogress-0.2.2 fastscript-0.1.4

I was talking of the notebooks. There is no RegexLabeller(r’([^/]+)_\d+.jpg$’) in the pets notebooks

Still getting same error from course nbs lesson 1-pets :grinning:

crop_func = RandomResizedCrop(460, min_scale=0.75, ratio=(1.,1.))

dbunch = ImageDataBunch.from_name_re(
path, fnames, pat=r’(.+)_\d+.jpg$’, item_tfms=crop_func, bs=bs,
batch_tfms=[*aug_transforms(size=224), Normalize.from_stats(*imagenet_stats)])


TypeError Traceback (most recent call last)
in
3 dbunch = ImageDataBunch.from_name_re(
4 path, fnames, pat=r’(.+)_\d+.jpg$’, item_tfms=crop_func, bs=bs,
----> 5 batch_tfms=[*aug_transforms(size=224), Normalize.from_stats(*imagenet_stats)])

d:\codes\fastai_dev\fastai2\fastai2\vision\data.py in from_name_re(cls, path, fnames, pat, **kwargs)
57 def from_name_re(cls, path, fnames, pat, **kwargs):
58 “Create from name attrs in list of fnames in paths with re expression pat.”
—> 59 return cls.from_name_func(path, fnames, RegexLabeller(pat), **kwargs)
60
61 @classmethod

d:\codes\fastai_dev\fastai2\fastai2\vision\data.py in from_name_func(cls, path, fnames, label_func, valid_pct, seed, **kwargs)
45 "Create from name attrs in list of fnames in paths with label_func"
46 f = using_attr(label_func, ‘name’)
—> 47 return cls.from_path_func(path, fnames, f, valid_pct=valid_pct, seed=seed, **kwargs)
48
49 @classmethod

d:\codes\fastai_dev\fastai2\fastai2\vision\data.py in from_path_func(cls, path, fnames, label_func, valid_pct, seed, **kwargs)
38 splitter=RandomSplitter(valid_pct, seed=seed),
39 get_y=label_func)
—> 40 return cls.from_dblock(dblock, fnames, path=path, **kwargs)
41
42 @classmethod

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in from_dblock(cls, dblock, source, path, type_tfms, item_tfms, batch_tfms, **kwargs)
122 @delegates(TfmdDL.init)
123 def from_dblock(cls, dblock, source, path=’.’, type_tfms=None, item_tfms=None, batch_tfms=None, **kwargs):
–> 124 return dblock.databunch(source, path=path, type_tfms=type_tfms, item_tfms=item_tfms, batch_tfms=batch_tfms, **kwargs)
125
126 _docs=dict(getitem=“Retrieve DataLoader at i (0 is training, 1 is validation)”,

d:\codes\fastai_dev\fastai2\fastai2\data\block.py in databunch(self, source, path, type_tfms, item_tfms, batch_tfms, **kwargs)
80
81 def databunch(self, source, path=’.’, type_tfms=None, item_tfms=None, batch_tfms=None, **kwargs):
—> 82 dsrc = self.datasource(source, type_tfms=type_tfms)
83 item_tfms = _merge_tfms(self.default_item_tfms, item_tfms)
84 batch_tfms = _merge_tfms(self.default_batch_tfms, batch_tfms)

d:\codes\fastai_dev\fastai2\fastai2\data\block.py in datasource(self, source, type_tfms)
77 type_tfms = L([self.default_type_tfms, type_tfms, labellers]).map_zip(
78 lambda tt,tfm,l: L(l) + _merge_tfms(tt, tfm))
—> 79 return DataSource(items, tfms=type_tfms, splits=splits, dl_type=self.dl_type, n_inp=self.n_inp)
80
81 def databunch(self, source, path=’.’, type_tfms=None, item_tfms=None, batch_tfms=None, **kwargs):

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in init(self, items, tfms, tls, n_inp, dl_type, **kwargs)
231 def init(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
232 super().init(dl_type=dl_type)
–> 233 self.tls = L(tls if tls else [TfmdList(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
234 self.n_inp = (1 if len(self.tls)==1 else len(self.tls)-1) if n_inp is None else n_inp
235

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in (.0)
231 def init(self, items=None, tfms=None, tls=None, n_inp=None, dl_type=None, **kwargs):
232 super().init(dl_type=dl_type)
–> 233 self.tls = L(tls if tls else [TfmdList(items, t, **kwargs) for t in L(ifnone(tfms,[None]))])
234 self.n_inp = (1 if len(self.tls)==1 else len(self.tls)-1) if n_inp is None else n_inp
235

D:\conda3\lib\site-packages\fastcore\foundation.py in call(cls, x, args, **kwargs)
39 return x
40
—> 41 res = super().call(
((x,) + args), **kwargs)
42 res._newchk = 0
43 return res

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in init(self, items, tfms, use_list, do_setup, as_item, split_idx, train_setup, splits, types)
173 self.tfms = Pipeline(tfms, as_item=as_item, split_idx=split_idx)
174 self.types = types
–> 175 if do_setup: self.setup(train_setup=train_setup)
176
177 def _new(self, items, **kwargs): return super()._new(items, tfms=self.tfms, do_setup=False, types=self.types, **kwargs)

d:\codes\fastai_dev\fastai2\fastai2\data\core.py in setup(self, train_setup)
186
187 def setup(self, train_setup=True):
–> 188 self.tfms.setup(self, train_setup)
189 if len(self) != 0:
190 x,self.types = super().getitem(0),[]

TypeError: setup() takes from 1 to 2 positional arguments but 3 were given

Triple-check the enviromnent in which you are running your notebook, because I assure you this error isn’t there anymore with both masters of fastai2 and fastcore (tried one more time).
It’s a problem with the arguments of a function so it can’t be windows-related.