From 96eb7255b616dcb82bcec3cd1ed202402b7f4d92 Mon Sep 17 00:00:00 2001 From: Gerard Bentley Date: Mon, 9 Mar 2020 17:34:46 -0700 Subject: [PATCH] remove show_progress_bar from other tests --- tests/test_amp.py | 6 +----- tests/test_cpu_models.py | 19 +++++++++++-------- tests/test_gpu_models.py | 9 ++++----- tests/test_restore_models.py | 10 ++++------ tests/trainer/test_callbacks.py | 2 +- 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/tests/test_amp.py b/tests/test_amp.py index 832c7ba7a8c958..185b08ec39240e 100644 --- a/tests/test_amp.py +++ b/tests/test_amp.py @@ -22,7 +22,6 @@ def test_amp_single_gpu(tmpdir): trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=True, max_epochs=1, gpus=1, distributed_backend='ddp', @@ -45,7 +44,6 @@ def test_no_amp_single_gpu(tmpdir): trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=True, max_epochs=1, gpus=1, distributed_backend='dp', @@ -71,7 +69,6 @@ def test_amp_gpu_ddp(tmpdir): trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=True, max_epochs=1, gpus=2, distributed_backend='ddp', @@ -97,7 +94,6 @@ def test_amp_gpu_ddp_slurm_managed(tmpdir): model = LightningTestModel(hparams) trainer_options = dict( - show_progress_bar=True, max_epochs=1, gpus=[0], distributed_backend='ddp', @@ -135,7 +131,7 @@ def test_cpu_model_with_amp(tmpdir): trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, logger=tutils.get_test_tube_logger(tmpdir), max_epochs=1, train_percent_check=0.4, diff --git a/tests/test_cpu_models.py b/tests/test_cpu_models.py index 38fc790430fd71..09d2a732cf7a89 100644 --- a/tests/test_cpu_models.py +++ b/tests/test_cpu_models.py @@ -28,7 +28,7 @@ def test_early_stopping_cpu_model(tmpdir): gradient_clip_val=1.0, overfit_pct=0.20, track_grad_norm=2, - show_progress_bar=True, + print_nan_grads=True, logger=tutils.get_test_tube_logger(tmpdir), train_percent_check=0.1, val_percent_check=0.1, @@ -49,7 +49,8 @@ def test_lbfgs_cpu_model(tmpdir): trainer_options = dict( default_save_path=tmpdir, max_epochs=2, - show_progress_bar=False, + print_nan_grads=True, + progress_bar_refresh_rate=0, weights_summary='top', train_percent_check=1.0, val_percent_check=0.2, @@ -68,7 +69,8 @@ def test_default_logger_callbacks_cpu_model(tmpdir): max_epochs=1, gradient_clip_val=1.0, overfit_pct=0.20, - show_progress_bar=False, + print_nan_grads=True, + progress_bar_refresh_rate=0, train_percent_check=0.01, val_percent_check=0.01, ) @@ -96,7 +98,7 @@ def test_running_test_after_fitting(tmpdir): trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=4, train_percent_check=0.4, val_percent_check=0.2, @@ -134,7 +136,7 @@ class CurrentTestModel(LightTrainDataloader, LightTestMixin, TestModelBase): checkpoint = tutils.init_checkpoint_callback(logger) trainer_options = dict( - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=1, train_percent_check=0.4, val_percent_check=0.2, @@ -229,7 +231,7 @@ def test_cpu_model(tmpdir): trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, logger=tutils.get_test_tube_logger(tmpdir), max_epochs=1, train_percent_check=0.4, @@ -250,7 +252,8 @@ def test_all_features_cpu_model(tmpdir): gradient_clip_val=1.0, overfit_pct=0.20, track_grad_norm=2, - show_progress_bar=False, + print_nan_grads=True, + progress_bar_refresh_rate=0, logger=tutils.get_test_tube_logger(tmpdir), accumulate_grad_batches=2, max_epochs=1, @@ -347,7 +350,7 @@ def test_single_gpu_model(tmpdir): trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=1, train_percent_check=0.1, val_percent_check=0.1, diff --git a/tests/test_gpu_models.py b/tests/test_gpu_models.py index a95e4d42ddae11..5ec58cda559bb1 100644 --- a/tests/test_gpu_models.py +++ b/tests/test_gpu_models.py @@ -32,7 +32,6 @@ def test_multi_gpu_model_ddp2(tmpdir): model, hparams = tutils.get_model() trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=True, max_epochs=1, train_percent_check=0.4, val_percent_check=0.2, @@ -55,7 +54,7 @@ def test_multi_gpu_model_ddp(tmpdir): model, hparams = tutils.get_model() trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=1, train_percent_check=0.4, val_percent_check=0.2, @@ -76,7 +75,7 @@ def test_ddp_all_dataloaders_passed_to_fit(tmpdir): model, hparams = tutils.get_model() trainer_options = dict(default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=1, train_percent_check=0.4, val_percent_check=0.2, @@ -209,7 +208,7 @@ def test_multi_gpu_none_backend(tmpdir): model, hparams = tutils.get_model() trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=1, train_percent_check=0.1, val_percent_check=0.1, @@ -230,7 +229,7 @@ def test_multi_gpu_model_dp(tmpdir): model, hparams = tutils.get_model() trainer_options = dict( default_save_path=tmpdir, - show_progress_bar=False, + progress_bar_refresh_rate=0, distributed_backend='dp', max_epochs=1, train_percent_check=0.1, diff --git a/tests/test_restore_models.py b/tests/test_restore_models.py index cf3a6773ca142d..5ecde40af31302 100644 --- a/tests/test_restore_models.py +++ b/tests/test_restore_models.py @@ -34,7 +34,7 @@ def test_running_test_pretrained_model_ddp(tmpdir): checkpoint = tutils.init_checkpoint_callback(logger) trainer_options = dict( - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=1, train_percent_check=0.4, val_percent_check=0.2, @@ -82,7 +82,7 @@ def test_running_test_pretrained_model(tmpdir): checkpoint = tutils.init_checkpoint_callback(logger) trainer_options = dict( - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=4, train_percent_check=0.4, val_percent_check=0.2, @@ -115,7 +115,7 @@ def test_load_model_from_checkpoint(tmpdir): model = LightningTestModel(hparams) trainer_options = dict( - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=2, train_percent_check=0.4, val_percent_check=0.2, @@ -168,7 +168,6 @@ def test_running_test_pretrained_model_dp(tmpdir): checkpoint = tutils.init_checkpoint_callback(logger) trainer_options = dict( - show_progress_bar=True, max_epochs=4, train_percent_check=0.4, val_percent_check=0.2, @@ -206,7 +205,6 @@ def test_dp_resume(tmpdir): model = LightningTestModel(hparams) trainer_options = dict( - show_progress_bar=True, max_epochs=3, gpus=2, distributed_backend='dp', @@ -333,7 +331,7 @@ def test_model_saving_loading(tmpdir): def test_load_model_with_missing_hparams(tmpdir): trainer_options = dict( - show_progress_bar=False, + progress_bar_refresh_rate=0, max_epochs=1, checkpoint_callback=ModelCheckpoint(tmpdir, save_top_k=-1), logger=False, diff --git a/tests/trainer/test_callbacks.py b/tests/trainer/test_callbacks.py index 55a84633c87cad..c95ee10f44be2c 100644 --- a/tests/trainer/test_callbacks.py +++ b/tests/trainer/test_callbacks.py @@ -101,7 +101,7 @@ def on_test_end(self, trainer, pl_module): 'max_epochs': 1, 'val_percent_check': 0.1, 'train_percent_check': 0.2, - 'show_progress_bar': False + 'progress_bar_refresh_rate': 0 } assert not test_callback.on_init_start_called