Hi.
I am cloning and reassembling a dataset on Colab and fastai is throwing this error:
FileNotFoundError Traceback (most recent call last)
<ipython-input-6-83aaf782df36> in <module>()
3 path = Path('Food-101')
4
----> 5 food_names = get_image_files(train_image_path)
6
7 file_parse = r'/([^/]+)_\d+\.(png|jpg|jpeg)$'
1 frames
/usr/local/lib/python3.6/dist-packages/fastai/data_block.py in get_files(path, extensions, recurse, exclude, include, presort, followlinks)
42 return res
43 else:
---> 44 f = [o.name for o in os.scandir(path) if o.is_file()]
45 res = _get_files(path, path, f, extensions)
46 if presort: res = sorted(res, key=lambda p: _path_to_same_str(p), reverse=False)
FileNotFoundError: [Errno 2] No such file or directory: 'Food-101/images/train'
I checked multiple times and the files do exist. This is the full code that’s throwing the error:
train_image_path = Path('Food-101/images/train/')
test_image_path = Path('Food-101/images/test/')
path = Path('Food-101')
food_names = get_image_files(train_image_path)
file_parse = r'/([^/]+)_\d+\.(png|jpg|jpeg)$'
This is my file structure:
Food-101
images
test
train