From e8f700dcdb9128f10f11a03d8ece8269f79a9674 Mon Sep 17 00:00:00 2001 From: Oliver Borchert Date: Tue, 21 Dec 2021 03:13:29 +0100 Subject: [PATCH 1/2] Get rid of warning on --- pytorch_lightning/loops/epoch/prediction_epoch_loop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytorch_lightning/loops/epoch/prediction_epoch_loop.py b/pytorch_lightning/loops/epoch/prediction_epoch_loop.py index 3fb49e7d4b1a0..429d1239eacf5 100644 --- a/pytorch_lightning/loops/epoch/prediction_epoch_loop.py +++ b/pytorch_lightning/loops/epoch/prediction_epoch_loop.py @@ -68,8 +68,8 @@ def on_run_start( # type: ignore[override] void(dataloader_iter, dataloader_idx) self._dl_max_batches = dl_max_batches self._num_dataloaders = num_dataloaders - self._seen_batch_indices = self._get_batch_indices(dataloader_idx) self.return_predictions = return_predictions + self._seen_batch_indices = self._get_batch_indices(dataloader_idx) def advance( # type: ignore[override] self, From aaaa1f511441cd10d789ac86a38aae8e208947c8 Mon Sep 17 00:00:00 2001 From: Rohit Gupta Date: Tue, 21 Dec 2021 19:37:21 +0530 Subject: [PATCH 2/2] Update pytorch_lightning/loops/epoch/prediction_epoch_loop.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Carlos MocholĂ­ --- pytorch_lightning/loops/epoch/prediction_epoch_loop.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytorch_lightning/loops/epoch/prediction_epoch_loop.py b/pytorch_lightning/loops/epoch/prediction_epoch_loop.py index 429d1239eacf5..14ec50c489a86 100644 --- a/pytorch_lightning/loops/epoch/prediction_epoch_loop.py +++ b/pytorch_lightning/loops/epoch/prediction_epoch_loop.py @@ -69,6 +69,7 @@ def on_run_start( # type: ignore[override] self._dl_max_batches = dl_max_batches self._num_dataloaders = num_dataloaders self.return_predictions = return_predictions + # this call requires that `self.return_predictions` is set self._seen_batch_indices = self._get_batch_indices(dataloader_idx) def advance( # type: ignore[override]