course-v3
course-v3 copied to clipboard
label_from_folder can't handle different directories
I was running Lesson 7 in a Kaggle notebook. My Images were in: /kaggle/input/the-oxfordiiit-pet-dataset/images My generated images were in: /kaggle/working/image_gen
When I came to run the following it only shows the images and not the generated images:
print(path)
/kaggle/input/the-oxfordiiit-pet-dataset
def get_crit_data(classes, bs, size):
src = ImageList.from_folder(path, include=classes).split_by_rand_pct(0.1, seed=42)
ll = src.label_from_folder(classes=classes)
data = (ll.transform(get_transforms(max_zoom=2.), size=size)
.databunch(bs=bs).normalize(imagenet_stats))
data.c = 3
return data
data_crit = get_crit_data([name_gen, 'images'], bs=bs, size=size)
So it appears the label function cannot traverse different directories, or is unable to except dir paths in the folder string, e.g. '/kaggle/output/working/image_gen'