Skip to content

Commit

Permalink
Quick fix for latest snapshot (#566)
Browse files Browse the repository at this point in the history
Summary: Pull Request resolved: #566

Reviewed By: ananthsub

Differential Revision: D49927994

fbshipit-source-id: 899ebaaecf6c460086a1a70429c0fb31f881fb29
  • Loading branch information
amarathe10 authored and facebook-github-bot committed Oct 5, 2023
1 parent 587ea9a commit adcc839
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions torchtnt/framework/callbacks/torchsnapshot_saver.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,13 +366,12 @@ def _latest_checkpoint_path(dirpath: str) -> Optional[str]:

# Iterate through all files and directories in the specified directory
for candidate in candidate_dirpaths:
full_path = os.path.join(dirpath, candidate)
dir_contents = fs.ls(full_path)
dir_contents = fs.ls(candidate, False)
if not any(
SNAPSHOT_METADATA_FNAME == os.path.basename(f) for f in dir_contents
):
logger.warning(
f"Snapshot metadata is missing from {full_path}! Skipping this path"
f"Snapshot metadata is missing from {candidate}! Skipping this path"
)
continue

Expand Down

0 comments on commit adcc839

Please sign in to comment.