Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't pass tpu weights back on test #2566

Merged
merged 3 commits into from
Jul 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/distrib_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def tpu_train(self, tpu_core_idx, model):
self.run_pretrain_routine(model)

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

Expand Down
2 changes: 1 addition & 1 deletion pytorch_lightning/trainer/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ def fit(
xmp.spawn(self.tpu_train, args=(model,), nprocs=self.tpu_cores, start_method=start_method)

# load weights if not interrupted
if self.on_colab_kaggle:
if self.on_colab_kaggle and not self.testing:
self.load_spawn_weights(model)

self.model = model
Expand Down
4 changes: 3 additions & 1 deletion tests/callbacks/test_model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

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

Expand Down