mirror of
https://github.com/huggingface/pytorch-image-models.git
synced 2025-06-03 15:01:08 +08:00
Fiddling with iterator wrapping for HF ds streaming
This commit is contained in:
parent
992976f007
commit
2eac2f6955
@ -167,9 +167,11 @@ class ReaderHfids(Reader):
|
||||
|
||||
target_sample_count = self._num_samples_per_worker()
|
||||
sample_count = 0
|
||||
ds_iter = iter(self.ds)
|
||||
|
||||
if self.is_training:
|
||||
ds_iter = chain.from_iterable(repeat(ds_iter))
|
||||
ds_iter = chain.from_iterable(repeat(self.ds))
|
||||
else:
|
||||
ds_iter = iter(self.ds)
|
||||
for sample in ds_iter:
|
||||
input_data: Image.Image = sample[self.input_key]
|
||||
if self.input_img_mode and input_data.mode != self.input_img_mode:
|
||||
|
Loading…
x
Reference in New Issue
Block a user