Merge pull request #384 from boom1492/master

Fix error next iterators
This commit is contained in:
Geewook Kim 2023-07-16 15:04:32 +09:00 committed by GitHub
commit e2117f2fb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -84,12 +84,12 @@ class Batch_Balanced_Dataset(object):
for i, data_loader_iter in enumerate(self.dataloader_iter_list):
try:
image, text = data_loader_iter.next()
image, text = next(data_loader_iter)
balanced_batch_images.append(image)
balanced_batch_texts += text
except StopIteration:
self.dataloader_iter_list[i] = iter(self.data_loader_list[i])
image, text = self.dataloader_iter_list[i].next()
image, text = next(self.dataloader_iter_list[i])
balanced_batch_images.append(image)
balanced_batch_texts += text
except ValueError: