Browse Source

check list_eval_partition.txt file

tags/v1.0.0
yanghaitao1 5 years ago
parent
commit
f55f274bb4
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

@@ -4874,6 +4874,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