Skip to content

Commit e1ff4b2

Browse files
rohitgr7Borda
authored andcommitted
Update warning if ckpt directory is not empty (#5209)
1 parent 47be9ba commit e1ff4b2

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
@@ -301,8 +301,7 @@ def __init_ckpt_dir(self, filepath, dirpath, filename, save_top_k):
301301
and len(self._fs.ls(dirpath)) > 0
302302
):
303303
rank_zero_warn(
304-
f"Checkpoint directory {dirpath} exists and is not empty. With save_top_k={save_top_k},"
305-
" all files in this directory will be deleted when a checkpoint is saved!"
304+
f"Checkpoint directory {dirpath} exists and is not empty."
306305
)
307306

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

0 commit comments

Comments
 (0)