From 9b997c8616d5e94446fe48eee20daa3b9f93b424 Mon Sep 17 00:00:00 2001 From: s-rog <55400948+s-rog@users.noreply.github.com> Date: Thu, 6 Aug 2020 19:11:43 +0800 Subject: [PATCH] add test for none checkpoint in ddp_spawn (#2845) * add test for none checkpoint in ddp_spawn * fix code style * make sure checkpoint_callback is none * Fix tests Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com> --- tests/trainer/test_trainer.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/trainer/test_trainer.py b/tests/trainer/test_trainer.py index 3dbb7b7c07..d6641c2f7a 100644 --- a/tests/trainer/test_trainer.py +++ b/tests/trainer/test_trainer.py @@ -988,3 +988,17 @@ def test_trainer_setup_call(tmpdir): trainer.test(ckpt_path=None) assert trainer.stage == 'test' assert trainer.get_model().stage == 'test' + + +def test_trainer_ddp_spawn_none_checkpoint(tmpdir): + model = EvalModelTemplate() + trainer = Trainer( + default_root_dir=tmpdir, + max_epochs=1, + checkpoint_callback=None, + distributed_backend="ddp_spawn" + ) + assert trainer.checkpoint_callback is None + result = trainer.fit(model) + assert trainer.checkpoint_callback is None + assert result == 1