diff --git a/ldm/data/imagenet.py b/ldm/data/imagenet.py index 1c473f9c6..64d6db290 100644 --- a/ldm/data/imagenet.py +++ b/ldm/data/imagenet.py @@ -97,7 +97,7 @@ def _load(self): self.relpaths = self._filter_relpaths(self.relpaths) print("Removed {} files from filelist during filtering.".format(l1 - len(self.relpaths))) - self.synsets = [p.split("/")[0] for p in self.relpaths] + self.synsets = [p.split(os.sep)[0] for p in self.relpaths] self.abspaths = [os.path.join(self.datadir, p) for p in self.relpaths] unique_synsets = np.unique(self.synsets)