Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checkpoint flag assignment error (#42) #63

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions learning/train_jax_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,16 @@ def main(argv):
# Handle checkpoint loading
if _LOAD_CHECKPOINT_PATH.value is not None:
# Convert to absolute path
_LOAD_CHECKPOINT_PATH.value = epath.Path(
_LOAD_CHECKPOINT_PATH.value
).resolve()
if _LOAD_CHECKPOINT_PATH.value.is_dir():
latest_ckpts = list(_LOAD_CHECKPOINT_PATH.value.glob("*"))
ckpt_path = epath.Path(_LOAD_CHECKPOINT_PATH.value).resolve()
if ckpt_path.is_dir():
latest_ckpts = list(ckpt_path.glob("*"))
latest_ckpts = [ckpt for ckpt in latest_ckpts if ckpt.is_dir()]
latest_ckpts.sort(key=lambda x: int(x.name))
latest_ckpt = latest_ckpts[-1]
restore_checkpoint_path = latest_ckpt
print(f"Restoring from: {restore_checkpoint_path}")
else:
restore_checkpoint_path = _LOAD_CHECKPOINT_PATH.value
restore_checkpoint_path = ckpt_path
print(f"Restoring from checkpoint: {restore_checkpoint_path}")
else:
print("No checkpoint path provided, not restoring from checkpoint")
Expand Down
Loading