diff --git a/hw6_release/utils.py b/hw6_release/utils.py index fc564e28..c7ff38b0 100644 --- a/hw6_release/utils.py +++ b/hw6_release/utils.py @@ -44,7 +44,7 @@ def load_dataset(data_dir, train=True, as_grey=False, shuffle=True, seed=131): data_dir = os.path.join(data_dir, 'test') for i, cls in enumerate(sorted(os.listdir(data_dir))): - for img_file in os.listdir(os.path.join(data_dir, cls)): + for img_file in sorted(os.listdir(os.path.join(data_dir, cls))): img_path = os.path.join(data_dir, cls, img_file) img = img_as_float(io.imread(img_path, as_grey=as_grey)) X.append(img)