From c9b355586f6b4f0dd34f69a488f48ae1df30edeb Mon Sep 17 00:00:00 2001 From: Albert Zeyer Date: Wed, 30 Aug 2023 20:05:07 +0200 Subject: [PATCH] MetaDataset, fix for initialize Fix #1386 --- returnn/datasets/meta.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/returnn/datasets/meta.py b/returnn/datasets/meta.py index b1d6b0c7c4..3444b8139b 100644 --- a/returnn/datasets/meta.py +++ b/returnn/datasets/meta.py @@ -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])