Skip to content

Commit

Permalink
Merge pull request #53 from vincentzhang:main
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 727064864
Change-Id: I82a690120db8409e3687cb4bd2e30fa3a817083d
  • Loading branch information
copybara-github committed Feb 14, 2025
2 parents 0fb7bbd + 4b9878c commit 0b021c9
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion learning/notebooks/locomotion.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,7 @@
"print(f\"{ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)"
" json.dump(env_cfg.to_dict(), fp, indent=4)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion learning/train_jax_ppo.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def main(argv):

# Save environment configuration
with open(ckpt_path / "config.json", "w", encoding="utf-8") as fp:
json.dump(env_cfg.to_json(), fp, indent=4)
json.dump(env_cfg.to_dict(), fp, indent=4)

# Define policy parameters function for saving checkpoints
def policy_params_fn(current_step, make_policy, params): # pylint: disable=unused-argument
Expand Down
2 changes: 1 addition & 1 deletion learning/train_rsl_rl.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def main(argv):
with open(
os.path.join(ckpt_path, "config.json"), "w", encoding="utf-8"
) as fp:
json.dump(env_cfg.to_json(), fp, indent=4)
json.dump(env_cfg.to_dict(), fp, indent=4)

# Domain randomization
randomizer = registry.get_domain_randomizer(_ENV_NAME.value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"print(f\"{ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)"
" json.dump(env_cfg.to_dict(), fp, indent=4)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion mujoco_playground/experimental/learning/cube_rotate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"print(f\"{ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)"
" json.dump(env_cfg.to_dict(), fp, indent=4)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"print(f\"Checkpoint path: {ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)\n",
" json.dump(env_cfg.to_dict(), fp, indent=4)\n",
"\n",
"\n",
"def policy_params_fn(current_step, make_policy, params):\n",
Expand Down
2 changes: 1 addition & 1 deletion mujoco_playground/experimental/learning/getup.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"print(f\"{ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)"
" json.dump(env_cfg.to_dict(), fp, indent=4)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion mujoco_playground/experimental/learning/handstand.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"print(f\"{ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)"
" json.dump(env_cfg.to_dict(), fp, indent=4)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"print(f\"{ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)"
" json.dump(env_cfg.to_dict(), fp, indent=4)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"print(f\"Checkpoint path: {ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)\n",
" json.dump(env_cfg.to_dict(), fp, indent=4)\n",
"\n",
"\n",
"def policy_params_fn(current_step, make_policy, params):\n",
Expand Down
2 changes: 1 addition & 1 deletion mujoco_playground/experimental/learning/joystick.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
"print(f\"Checkpoint path: {ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)"
" json.dump(env_cfg.to_dict(), fp, indent=4)"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"print(f\"Checkpoint path: {ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)\n",
" json.dump(env_cfg.to_dict(), fp, indent=4)\n",
"\n",
"\n",
"def policy_params_fn(current_step, make_policy, params):\n",
Expand Down
2 changes: 1 addition & 1 deletion mujoco_playground/experimental/learning/open_cabinet.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"print(f\"Checkpoint path: {ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)\n",
" json.dump(env_cfg.to_dict(), fp, indent=4)\n",
"\n",
"\n",
"def policy_params_fn(current_step, make_policy, params):\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"print(f\"Checkpoint path: {ckpt_path}\")\n",
"\n",
"with open(ckpt_path / \"config.json\", \"w\") as fp:\n",
" json.dump(env_cfg.to_json(), fp, indent=4)\n",
" json.dump(env_cfg.to_dict(), fp, indent=4)\n",
"\n",
"\n",
"def policy_params_fn(current_step, make_policy, params):\n",
Expand Down

0 comments on commit 0b021c9

Please sign in to comment.