Browse Source

!6451 check if partition file exists when usage is not all in CelebADataset

Merge pull request !6451 from yanghaitao/yht_celeba_log
tags/v1.0.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
d09025acab
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      mindspore/dataset/engine/datasets.py

+ 6
- 0
mindspore/dataset/engine/datasets.py View File

@@ -4940,6 +4940,12 @@ class CelebADataset(MappableDataset):
self.shard_id = shard_id
self.shuffle_level = shuffle

if usage != "all":
dir = os.path.realpath(self.dataset_dir)
partition_file = os.path.join(dir, "list_eval_partition.txt")
if os.path.exists(partition_file) is False:
raise RuntimeError("Partition file can not be found when usage is not 'all'.")

def get_args(self):
args = super().get_args()
args["dataset_dir"] = self.dataset_dir


Loading…
Cancel
Save