Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -21,7 +21,7 @@ model-index:
|
|
| 21 |
type: OpenAI/Gym/MuJoCo-Walker2d-v3
|
| 22 |
metrics:
|
| 23 |
- type: mean_reward
|
| 24 |
-
value:
|
| 25 |
name: mean_reward
|
| 26 |
---
|
| 27 |
|
|
@@ -53,7 +53,8 @@ wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O mujoco.tar.gz
|
|
| 53 |
tar -xf mujoco.tar.gz -C ~/.mujoco
|
| 54 |
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin" >> ~/.bashrc
|
| 55 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin
|
| 56 |
-
pip3 install
|
|
|
|
| 57 |
|
| 58 |
```
|
| 59 |
</details>
|
|
@@ -76,9 +77,9 @@ import torch
|
|
| 76 |
|
| 77 |
# Pull model from files which are git cloned from huggingface
|
| 78 |
policy_state_dict = torch.load("pytorch_model.bin", map_location=torch.device("cpu"))
|
| 79 |
-
cfg = EasyDict(Config.file_to_dict("policy_config.py"))
|
| 80 |
# Instantiate the agent
|
| 81 |
-
agent = PPOF(
|
| 82 |
# Continue training
|
| 83 |
agent.train(step=5000)
|
| 84 |
# Render the new agent performance
|
|
@@ -104,7 +105,7 @@ from huggingface_ding import pull_model_from_hub
|
|
| 104 |
# Pull model from Hugggingface hub
|
| 105 |
policy_state_dict, cfg = pull_model_from_hub(repo_id="OpenDILabCommunity/Walker2d-v3-PPO")
|
| 106 |
# Instantiate the agent
|
| 107 |
-
agent = PPOF(
|
| 108 |
# Continue training
|
| 109 |
agent.train(step=5000)
|
| 110 |
# Render the new agent performance
|
|
@@ -130,9 +131,9 @@ from ding.bonus import PPOF
|
|
| 130 |
from huggingface_ding import push_model_to_hub
|
| 131 |
|
| 132 |
# Instantiate the agent
|
| 133 |
-
agent = PPOF(
|
| 134 |
# Train the agent
|
| 135 |
-
return_ = agent.train(step=int(
|
| 136 |
# Push model to huggingface hub
|
| 137 |
push_model_to_hub(
|
| 138 |
agent=agent.best,
|
|
@@ -164,12 +165,14 @@ wget https://mujoco.org/download/mujoco210-linux-x86_64.tar.gz -O mujoco.tar.gz
|
|
| 164 |
tar -xf mujoco.tar.gz -C ~/.mujoco
|
| 165 |
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin" >> ~/.bashrc
|
| 166 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin
|
| 167 |
-
pip3 install
|
|
|
|
| 168 |
''',
|
| 169 |
usage_file_by_git_clone="./ppo/walker2d_ppo_deploy.py",
|
| 170 |
usage_file_by_huggingface_ding="./ppo/walker2d_ppo_download.py",
|
| 171 |
train_file="./ppo/walker2d_ppo.py",
|
| 172 |
-
repo_id="OpenDILabCommunity/
|
|
|
|
| 173 |
)
|
| 174 |
|
| 175 |
```
|
|
@@ -204,7 +207,9 @@ exp_config = {
|
|
| 204 |
'unroll_len': 1,
|
| 205 |
'deterministic_eval': True,
|
| 206 |
'model': {},
|
| 207 |
-
'cfg_type': 'PPOFPolicyDict'
|
|
|
|
|
|
|
| 208 |
}
|
| 209 |
|
| 210 |
```
|
|
@@ -212,23 +217,23 @@ exp_config = {
|
|
| 212 |
|
| 213 |
**Training Procedure**
|
| 214 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 215 |
-
- **Weights & Biases (wandb):** [monitor link](https://wandb.ai/
|
| 216 |
|
| 217 |
## Model Information
|
| 218 |
<!-- Provide the basic links for the model. -->
|
| 219 |
- **Github Repository:** [repo link](https://github.com/opendilab/DI-engine)
|
| 220 |
- **Doc**: [DI-engine-docs Algorithm link](https://di-engine-docs.readthedocs.io/en/latest/12_policies/ppo.html)
|
| 221 |
-
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/
|
| 222 |
-
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/
|
| 223 |
<!-- Provide the size information for the model. -->
|
| 224 |
- **Parameters total size:** 385.85 KB
|
| 225 |
-
- **Last Update Date:** 2023-
|
| 226 |
|
| 227 |
## Environments
|
| 228 |
<!-- Address questions around what environment the model is intended to be trained and deployed at, including the necessary information needed to be provided for future users. -->
|
| 229 |
- **Benchmark:** OpenAI/Gym/MuJoCo
|
| 230 |
- **Task:** Walker2d-v3
|
| 231 |
- **Gym version:** 0.25.1
|
| 232 |
-
- **DI-engine version:** v0.4.
|
| 233 |
-
- **PyTorch version:**
|
| 234 |
- **Doc**: [DI-engine-docs Environments link](https://di-engine-docs.readthedocs.io/en/latest/13_envs/mujoco.html)
|
|
|
|
| 21 |
type: OpenAI/Gym/MuJoCo-Walker2d-v3
|
| 22 |
metrics:
|
| 23 |
- type: mean_reward
|
| 24 |
+
value: 3981.94 +/- 1332.9
|
| 25 |
name: mean_reward
|
| 26 |
---
|
| 27 |
|
|
|
|
| 53 |
tar -xf mujoco.tar.gz -C ~/.mujoco
|
| 54 |
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin" >> ~/.bashrc
|
| 55 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin
|
| 56 |
+
pip3 install "cython<3"
|
| 57 |
+
pip3 install DI-engine[common_env,video]
|
| 58 |
|
| 59 |
```
|
| 60 |
</details>
|
|
|
|
| 77 |
|
| 78 |
# Pull model from files which are git cloned from huggingface
|
| 79 |
policy_state_dict = torch.load("pytorch_model.bin", map_location=torch.device("cpu"))
|
| 80 |
+
cfg = EasyDict(Config.file_to_dict("policy_config.py").cfg_dict)
|
| 81 |
# Instantiate the agent
|
| 82 |
+
agent = PPOF(env_id="Walker2d-v3", exp_name="Walker2d-v3-PPO", cfg=cfg.exp_config, policy_state_dict=policy_state_dict)
|
| 83 |
# Continue training
|
| 84 |
agent.train(step=5000)
|
| 85 |
# Render the new agent performance
|
|
|
|
| 105 |
# Pull model from Hugggingface hub
|
| 106 |
policy_state_dict, cfg = pull_model_from_hub(repo_id="OpenDILabCommunity/Walker2d-v3-PPO")
|
| 107 |
# Instantiate the agent
|
| 108 |
+
agent = PPOF(env_id="Walker2d-v3", exp_name="Walker2d-v3-PPO", cfg=cfg.exp_config, policy_state_dict=policy_state_dict)
|
| 109 |
# Continue training
|
| 110 |
agent.train(step=5000)
|
| 111 |
# Render the new agent performance
|
|
|
|
| 131 |
from huggingface_ding import push_model_to_hub
|
| 132 |
|
| 133 |
# Instantiate the agent
|
| 134 |
+
agent = PPOF(env_id="Walker2d-v3", exp_name="Walker2d-v3-PPO")
|
| 135 |
# Train the agent
|
| 136 |
+
return_ = agent.train(step=int(5000000))
|
| 137 |
# Push model to huggingface hub
|
| 138 |
push_model_to_hub(
|
| 139 |
agent=agent.best,
|
|
|
|
| 165 |
tar -xf mujoco.tar.gz -C ~/.mujoco
|
| 166 |
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin" >> ~/.bashrc
|
| 167 |
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.mujoco/mjpro210/bin:~/.mujoco/mujoco210/bin
|
| 168 |
+
pip3 install "cython<3"
|
| 169 |
+
pip3 install DI-engine[common_env,video]
|
| 170 |
''',
|
| 171 |
usage_file_by_git_clone="./ppo/walker2d_ppo_deploy.py",
|
| 172 |
usage_file_by_huggingface_ding="./ppo/walker2d_ppo_download.py",
|
| 173 |
train_file="./ppo/walker2d_ppo.py",
|
| 174 |
+
repo_id="OpenDILabCommunity/Walker2d-v3-PPO",
|
| 175 |
+
create_repo=False
|
| 176 |
)
|
| 177 |
|
| 178 |
```
|
|
|
|
| 207 |
'unroll_len': 1,
|
| 208 |
'deterministic_eval': True,
|
| 209 |
'model': {},
|
| 210 |
+
'cfg_type': 'PPOFPolicyDict',
|
| 211 |
+
'env_id': 'Walker2d-v3',
|
| 212 |
+
'exp_name': 'Walker2d-v3-PPO'
|
| 213 |
}
|
| 214 |
|
| 215 |
```
|
|
|
|
| 217 |
|
| 218 |
**Training Procedure**
|
| 219 |
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
| 220 |
+
- **Weights & Biases (wandb):** [monitor link](https://wandb.ai/zjowowen/Walker2d-v3-PPO)
|
| 221 |
|
| 222 |
## Model Information
|
| 223 |
<!-- Provide the basic links for the model. -->
|
| 224 |
- **Github Repository:** [repo link](https://github.com/opendilab/DI-engine)
|
| 225 |
- **Doc**: [DI-engine-docs Algorithm link](https://di-engine-docs.readthedocs.io/en/latest/12_policies/ppo.html)
|
| 226 |
+
- **Configuration:** [config link](https://huggingface.co/OpenDILabCommunity/Walker2d-v3-PPO/blob/main/policy_config.py)
|
| 227 |
+
- **Demo:** [video](https://huggingface.co/OpenDILabCommunity/Walker2d-v3-PPO/blob/main/replay.mp4)
|
| 228 |
<!-- Provide the size information for the model. -->
|
| 229 |
- **Parameters total size:** 385.85 KB
|
| 230 |
+
- **Last Update Date:** 2023-09-25
|
| 231 |
|
| 232 |
## Environments
|
| 233 |
<!-- Address questions around what environment the model is intended to be trained and deployed at, including the necessary information needed to be provided for future users. -->
|
| 234 |
- **Benchmark:** OpenAI/Gym/MuJoCo
|
| 235 |
- **Task:** Walker2d-v3
|
| 236 |
- **Gym version:** 0.25.1
|
| 237 |
+
- **DI-engine version:** v0.4.9
|
| 238 |
+
- **PyTorch version:** 2.0.1+cu117
|
| 239 |
- **Doc**: [DI-engine-docs Environments link](https://di-engine-docs.readthedocs.io/en/latest/13_envs/mujoco.html)
|