Skip to content

Commit

Permalink
Fix unittest random failed of test_datasets (PaddlePaddle#30804)
Browse files Browse the repository at this point in the history
* fix test_datasets unittest
  • Loading branch information
LielinJiang authored Feb 2, 2021
1 parent 04532b8 commit 3a3ff75
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/paddle/vision/datasets/flowers.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ def _load_anno(self):

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]

Expand Down

0 comments on commit 3a3ff75

Please sign in to comment.