From ca8b8586b29274bb4ae2fae3662d6609be42c6b4 Mon Sep 17 00:00:00 2001 From: LielinJiang <50691816+LielinJiang@users.noreply.github.com> Date: Fri, 26 Nov 2021 10:02:24 +0800 Subject: [PATCH] Fix the issue of disordered loading cifar data (#37272) (#37528) --- python/paddle/vision/datasets/cifar.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/paddle/vision/datasets/cifar.py b/python/paddle/vision/datasets/cifar.py index 74ae8ef11e..3028d8697a 100644 --- a/python/paddle/vision/datasets/cifar.py +++ b/python/paddle/vision/datasets/cifar.py @@ -140,6 +140,8 @@ class Cifar10(Dataset): names = (each_item.name for each_item in f if self.flag in each_item.name) + names = sorted(list(names)) + for name in names: batch = pickle.load(f.extractfile(name), encoding='bytes') -- GitLab