Skip to content

Commit

Permalink
Merge pull request #1770 from feffy380/fix-size-from-cache
Browse files Browse the repository at this point in the history
fix: sort order when getting image size from cache file
  • Loading branch information
kohya-ss authored Nov 9, 2024
2 parents 123474d + b3248a8 commit 2a2042a
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 2a2042a

Please sign in to comment.