Skip to content

Commit

Permalink
MetaDataset, fix for initialize
Browse files Browse the repository at this point in the history
Fix #1386
  • Loading branch information
albertz committed Aug 30, 2023
1 parent 6839833 commit c9b3555
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions returnn/datasets/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ def init_seq_order(self, epoch=None, seq_list=None, seq_order=None):
or self.expected_load_seq_start > 0
)
super(MetaDataset, self).init_seq_order(epoch=epoch, seq_list=seq_list, seq_order=seq_order)
if epoch is None:
# This is called via initialize() with epoch=None, just to init some other things.
self.epoch = None # make sure we properly reinit
# We are not expected to have prepared any real epoch here.
self._num_seqs = 0
return True

if not need_reinit:
self._num_seqs = len(self.seq_list_ordered[self.default_dataset_key])
Expand Down

0 comments on commit c9b3555

Please sign in to comment.