Hi,
I am trying to follow the steps from Lesson 2 and not able to get ImageDataBunch to work.
I followed the steps exactly from lesson 2 in exactly same manner but get below error. Basically, I don’t have train, valid and test folders created but I am providing valid_pct parameter. Can someone please help in pointing out what may be wrong? Thanks in advance:
ImageDataBunch Code:
np.random.seed(42)
data = ImageDataBunch.from_folder(path, train=".", valid_pct=0.2, ds_tfms=get_transforms(), size=224, num_workers=4).normalize(imagenet_stats)
Error:
/usr/local/lib/python3.6/dist-packages/fastai/data_block.py:451: UserWarning: Your training set is empty. If this is by design, pass ignore_empty=True
to remove this warning. warn(“Your training set is empty. If this is by design, pass ignore_empty=True
to remove this warning.”) /usr/local/lib/python3.6/dist-packages/fastai/data_block.py:454: UserWarning: Your validation set is empty. If this is by design, use split_none()
or pass ignore_empty=True
when labelling to remove this warning. or pass ignore_empty=True
when labelling to remove this warning.""")
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-14-f59111772c82> in <module>() 1 np.random.seed(42) ----> 2 data = ImageDataBunch.from_folder(path, train=".", valid_pct=0.2, ds_tfms=get_transforms(), size=224, num_workers=4).normalize(imagenet_stats) 3
6 frames
/usr/local/lib/python3.6/dist-packages/fastai/core.py in index_row(a, idxs) 274 if isinstance(res,(pd.DataFrame,pd.Series)): return res.copy() 275 return res --> 276 return a[idxs] 277 278 def func_args(func)->bool:
IndexError: index 0 is out of bounds for axis 0 with size 0