From 097722794548f78c433296d421f396c70f21f9ca Mon Sep 17 00:00:00 2001 From: bigpo Date: Fri, 25 Dec 2020 16:58:40 +0800 Subject: [PATCH] Update unpaired_dataset.py (#131) bug fix --- ppgan/datasets/unpaired_dataset.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppgan/datasets/unpaired_dataset.py b/ppgan/datasets/unpaired_dataset.py index 18f4767..b55cb7c 100644 --- a/ppgan/datasets/unpaired_dataset.py +++ b/ppgan/datasets/unpaired_dataset.py @@ -62,7 +62,7 @@ class UnpairedDataset(BaseDataset): def __getitem__(self, idx): if self.is_train: img_a_path = self.data_infos_a[idx % self.size_a]['path'] - idx_b = random.randint(0, self.size_b) + idx_b = random.randint(0, self.size_b - 1) img_b_path = self.data_infos_b[idx_b]['path'] datas = dict(A_path=img_a_path, B_path=img_b_path) else: -- GitLab