-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: # Context For directories containing `_` in other parts of the name besides `epoch_0_step_0` (ex `tmp/fjad_213/epoch_0_step_0`), `_retrieve_checkpoint_dirpaths` can raise errors as it splits on `_` assuming underscore only appears in the final part of the path separating the epoch and step counts ``` >> ckpt_dirpaths.sort(key=lambda x: (int(x.split("_")[1]), int(x.split("_")[3]))) ValueError: invalid literal for int() with base 10: 'tmp/tmpcinmegj2/epoch' ``` # This diff When sorting the paths, calls `os.path.basename(path)` first, to only consider the `epoch_0_step_0` part of the path. Reviewed By: galrotem Differential Revision: D51916358 fbshipit-source-id: 1d08847ea31a6612393663c839c5fec38b076988
- Loading branch information
1 parent
2c6a7c8
commit c5d913c
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters