Skip to content

Commit

Permalink
Merge pull request fastai#174 from radekosmulski/make_it_clear_that_t…
Browse files Browse the repository at this point in the history
…ransforms_are_needed

Add assertion
  • Loading branch information
jph00 authored Feb 23, 2018
2 parents e6643fa + 78da4ce commit 9f3d96d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fastai/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ def from_paths(cls, path, bs=64, tfms=(None,None), trn_name='train', val_name='v
Returns:
ImageClassifierData
"""
assert isinstance(tfms[0], Transforms) and isinstance(tfms[1], Transforms), \
"please provide transformations for your train and validation sets"
trn,val = [folder_source(path, o) for o in (trn_name, val_name)]
test_fnames = read_dir(path, test_name) if test_name else None
datasets = cls.get_ds(FilesIndexArrayDataset, trn, val, tfms, path=path, test=test_fnames)
Expand Down

0 comments on commit 9f3d96d

Please sign in to comment.