Skip to content

Commit 9f3d96d

Browse files
authored
Merge pull request fastai#174 from radekosmulski/make_it_clear_that_transforms_are_needed
Add assertion
2 parents e6643fa + 78da4ce commit 9f3d96d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fastai/dataset.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,8 @@ def from_paths(cls, path, bs=64, tfms=(None,None), trn_name='train', val_name='v
365365
Returns:
366366
ImageClassifierData
367367
"""
368+
assert isinstance(tfms[0], Transforms) and isinstance(tfms[1], Transforms), \
369+
"please provide transformations for your train and validation sets"
368370
trn,val = [folder_source(path, o) for o in (trn_name, val_name)]
369371
test_fnames = read_dir(path, test_name) if test_name else None
370372
datasets = cls.get_ds(FilesIndexArrayDataset, trn, val, tfms, path=path, test=test_fnames)

0 commit comments

Comments
 (0)