Skip to content

Commit b738126

Browse files
don't pass tpu weights back on test (#2566)
* enable none checkpoint * enable none checkpoint
1 parent 6f4a488 commit b738126

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

pytorch_lightning/trainer/distrib_parts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def tpu_train(self, tpu_core_idx, model):
222222
self.run_pretrain_routine(model)
223223

224224
# when training ends on these platforms dump weights to get out of the main process
225-
if self.on_colab_kaggle:
225+
if self.on_colab_kaggle and not self.testing:
226226
rank_zero_warn('cleaning up... please do not interrupt')
227227
self.save_spawn_weights(model)
228228

pytorch_lightning/trainer/trainer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ def fit(
10141014
xmp.spawn(self.tpu_train, args=(model,), nprocs=self.tpu_cores, start_method=start_method)
10151015

10161016
# load weights if not interrupted
1017-
if self.on_colab_kaggle:
1017+
if self.on_colab_kaggle and not self.testing:
10181018
self.load_spawn_weights(model)
10191019

10201020
self.model = model

tests/callbacks/test_model_checkpoint.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515

1616
@pytest.mark.parametrize('save_top_k', [-1, 0, 1, 2])
1717
def test_model_checkpoint_with_non_string_input(tmpdir, save_top_k):
18-
""" Test that None in checkpoint callback is valid and that chkp_path is set correctly """
18+
"""
19+
Test that None in checkpoint callback is valid and that chkp_path is set correctly
20+
"""
1921
tutils.reset_seed()
2022
model = EvalModelTemplate()
2123

0 commit comments

Comments
 (0)