Skip to content

Commit c8eda3f

Browse files
authored
Update warning if ckpt directory is not empty (#5209)
1 parent be3e870 commit c8eda3f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pytorch_lightning/callbacks/model_checkpoint.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
2121
"""
2222

23+
from copy import deepcopy
2324
import numbers
2425
import os
25-
import re
26-
from copy import deepcopy
2726
from pathlib import Path
27+
import re
2828
from typing import Any, Dict, Optional, Union
2929

3030
import numpy as np
@@ -302,8 +302,7 @@ def __init_ckpt_dir(self, filepath, dirpath, filename, save_top_k):
302302
and len(self._fs.ls(dirpath)) > 0
303303
):
304304
rank_zero_warn(
305-
f"Checkpoint directory {dirpath} exists and is not empty. With save_top_k={save_top_k},"
306-
" all files in this directory will be deleted when a checkpoint is saved!"
305+
f"Checkpoint directory {dirpath} exists and is not empty."
307306
)
308307

309308
if dirpath and self._fs.protocol == 'file':

0 commit comments

Comments
 (0)