Remove reference to training in checkpoint loading error message (#18554)

This commit is contained in:
Adrian Wälchli 2023-09-15 16:45:27 -07:00 committed by GitHub
parent c1ee22a687
commit 3aa08b087f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ class TorchCheckpointIO(CheckpointIO):
# Try to read the checkpoint at `path`. If not exist, do not restore checkpoint.
fs = get_filesystem(path)
if not fs.exists(path):
raise FileNotFoundError(f"Checkpoint at {path} not found. Aborting training.")
raise FileNotFoundError(f"Checkpoint file not found: {path}")
return pl_load(path, map_location=map_location)

View File

@ -260,7 +260,7 @@ def test_try_resume_from_non_existing_checkpoint(tmpdir):
model = BoringModel()
trainer = Trainer()
with pytest.raises(FileNotFoundError, match="Aborting training"):
with pytest.raises(FileNotFoundError, match="Checkpoint file not found"):
trainer.fit(model, ckpt_path=str(tmpdir / "non_existing.ckpt"))

View File

@ -83,7 +83,7 @@ def test_hpc_restore_attempt(_, tmpdir):
# case 2: explicit resume path provided, file not found
trainer = Trainer(default_root_dir=tmpdir, max_steps=3)
with pytest.raises(FileNotFoundError, match="Checkpoint at not existing not found. Aborting training."):
with pytest.raises(FileNotFoundError, match="Checkpoint file not found: not existing"):
trainer.fit(model, ckpt_path="not existing")