Skip to content

Commit 3aa08b0

Browse files
authored
Remove reference to training in checkpoint loading error message (#18554)
1 parent c1ee22a commit 3aa08b0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/lightning/fabric/plugins/io/torch_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def load_checkpoint(
7575
# Try to read the checkpoint at `path`. If not exist, do not restore checkpoint.
7676
fs = get_filesystem(path)
7777
if not fs.exists(path):
78-
raise FileNotFoundError(f"Checkpoint at {path} not found. Aborting training.")
78+
raise FileNotFoundError(f"Checkpoint file not found: {path}")
7979

8080
return pl_load(path, map_location=map_location)
8181

tests/tests_pytorch/models/test_restore.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def test_try_resume_from_non_existing_checkpoint(tmpdir):
260260
model = BoringModel()
261261
trainer = Trainer()
262262

263-
with pytest.raises(FileNotFoundError, match="Aborting training"):
263+
with pytest.raises(FileNotFoundError, match="Checkpoint file not found"):
264264
trainer.fit(model, ckpt_path=str(tmpdir / "non_existing.ckpt"))
265265

266266

tests/tests_pytorch/trainer/connectors/test_checkpoint_connector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_hpc_restore_attempt(_, tmpdir):
8383
# case 2: explicit resume path provided, file not found
8484
trainer = Trainer(default_root_dir=tmpdir, max_steps=3)
8585

86-
with pytest.raises(FileNotFoundError, match="Checkpoint at not existing not found. Aborting training."):
86+
with pytest.raises(FileNotFoundError, match="Checkpoint file not found: not existing"):
8787
trainer.fit(model, ckpt_path="not existing")
8888

8989

0 commit comments

Comments
 (0)