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>
This commit is contained in:
parent
767c44950c
commit
9b997c8616
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue