Skip to content

Commit

Permalink
Update warning if ckpt directory is not empty (#5209)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitgr7 committed Dec 21, 2020
1 parent be3e870 commit c8eda3f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pytorch_lightning/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"""

from copy import deepcopy
import numbers
import os
import re
from copy import deepcopy
from pathlib import Path
import re
from typing import Any, Dict, Optional, Union

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

if dirpath and self._fs.protocol == 'file':
Expand Down

0 comments on commit c8eda3f

Please sign in to comment.