From c4cbff9b7ff3d51f11e216d2f67baddb904a2e7b Mon Sep 17 00:00:00 2001 From: ananthsub Date: Wed, 28 Apr 2021 21:58:28 -0700 Subject: [PATCH] Update test_dataloaders.py --- tests/trainer/test_dataloaders.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/trainer/test_dataloaders.py b/tests/trainer/test_dataloaders.py index d3205242656f58..83b9a7dbdecb96 100644 --- a/tests/trainer/test_dataloaders.py +++ b/tests/trainer/test_dataloaders.py @@ -1112,14 +1112,6 @@ def test_dataloaders_load_only_once_val_interval(tmpdir): expected_sequence = [ 'val_dataloader', 'train_dataloader', - # This has subsequent calls to val_dataloader - # because the training loop runs the evaluation loop, - # which reloads the val dataloader again. - # We cannot yet rely on trainer.current_epoch=0 to skip reloading - # the val dataloader on the first epoch because this only tracks the training epoch - # meaning multiple passes through the validation data within a single training epoch - # would not have the datalodaer reloaded. - # This breaks the assumption behind reload_dataloaders_every_epoch=True 'val_dataloader', 'val_dataloader', 'val_dataloader', @@ -1244,6 +1236,14 @@ def validation_step(self, batch, batch_idx): expected_sequence = [ 'train_dataloader', 'val_dataloader', + # This has subsequent calls to val_dataloader + # because the training loop runs the evaluation loop, + # which reloads the val dataloader again. + # We cannot yet rely on trainer.current_epoch=0 to skip reloading + # the val dataloader on the first epoch because this only tracks the training epoch + # meaning multiple passes through the validation data within a single training epoch + # would not have the datalodaer reloaded. + # This breaks the assumption behind reload_dataloaders_every_epoch=True 'val_dataloader', 'train_dataloader', 'val_dataloader',