From 3a3ff75c52042891e314b0dbbf2f7ff069e44c44 Mon Sep 17 00:00:00 2001 From: LielinJiang <50691816+LielinJiang@users.noreply.github.com> Date: Tue, 2 Feb 2021 15:08:17 +0800 Subject: [PATCH] Fix unittest random failed of test_datasets (#30804) * fix test_datasets unittest --- python/paddle/vision/datasets/flowers.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/python/paddle/vision/datasets/flowers.py b/python/paddle/vision/datasets/flowers.py index 29c6ace6f5e..448d6efb52b 100644 --- a/python/paddle/vision/datasets/flowers.py +++ b/python/paddle/vision/datasets/flowers.py @@ -128,6 +128,13 @@ class Flowers(Dataset): scio = try_import('scipy.io') + # double check data download + self.label_file = _check_exists_and_download(self.label_file, LABEL_URL, + LABEL_MD5, 'flowers', True) + + self.setid_file = _check_exists_and_download(self.setid_file, SETID_URL, + SETID_MD5, 'flowers', True) + self.labels = scio.loadmat(self.label_file)['labels'][0] self.indexes = scio.loadmat(self.setid_file)[self.flag][0] -- GitLab