Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

Ensure PPOAgent.save creates directories#6

Open
romgenie wants to merge 1 commit into
mainfrom
codex/add-directory-creation-before-save
Open

Ensure PPOAgent.save creates directories#6
romgenie wants to merge 1 commit into
mainfrom
codex/add-directory-creation-before-save

Conversation

@romgenie
Copy link
Copy Markdown
Contributor

@romgenie romgenie commented Aug 4, 2025

Summary

  • import os in PPO agent
  • ensure checkpoint directory exists before torch.save

Testing

  • python - <<'PY' import os, torch from agents.ppo_agent import PPOAgent agent = PPOAgent.__new__(PPOAgent) agent.network = torch.nn.Linear(1,1) agent.optimizer = torch.optim.Adam(agent.network.parameters()) agent.scheduler = torch.optim.lr_scheduler.LambdaLR(agent.optimizer, lambda _:1.0) agent.use_lstm = False agent.lstm_states = None agent.rnd_module = None agent.rnd_optimizer = None agent.rnd_reward_normalizer = None path = 'checkpoints/newdir/model.pt' agent.save(path, 0) print('Saved exists:', os.path.exists(path)) PY
  • PYTHONPATH=. pytest -q (fails: Failed to initialize SDL renderer; opencv-python package not installed)

https://chatgpt.com/codex/tasks/task_e_6891424d749483279897f32993e126dc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant