Skip to content

Commit

Permalink
fix: sort order when getting image size from cache file
Browse files Browse the repository at this point in the history
  • Loading branch information
feffy380 committed Nov 7, 2024
1 parent 588ea9e commit b3248a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/train_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -1887,7 +1887,7 @@ def load_dreambooth_dir(subset: DreamBoothSubset):

# make image path to npz path mapping
npz_paths = glob.glob(os.path.join(subset.image_dir, "*" + strategy.cache_suffix))
npz_paths.sort()
npz_paths.sort(key=lambda item: item.rsplit("_", maxsplit=2)[0]) # sort by name excluding resolution and cache_suffix
npz_path_index = 0

size_set_count = 0
Expand Down

0 comments on commit b3248a8

Please sign in to comment.